1#
2# %CopyrightBegin%
3#
4# Copyright Ericsson AB 2003-2020. All Rights Reserved.
5#
6# Licensed under the Apache License, Version 2.0 (the "License");
7# you may not use this file except in compliance with the License.
8# You may obtain a copy of the License at
9#
10#     http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS,
14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15# See the License for the specific language governing permissions and
16# limitations under the License.
17#
18# %CopyrightEnd%
19#
20
21#
22# Rules:
23# * Types, allocators, and classes can be declared.
24# * Types, allocators, classes, and descriptions can only contain
25#   alphanumeric characters.
26# * Allocators and classes have to be declared before they are used in
27#   type declarations.
28# * Descriptions have only one name space (i.e. class descriptions,
29#   allocator descriptions, and type descriptions are all in the same
30#   name space).
31# * Types, allocators, classes, and descriptions have different name
32#   spaces.
33# * The type, allocator, and class names INVALID are reserved and
34#   cannot be used.
35# * The descriptions invalid_allocator, invalid_class, and invalid_type
36#   are reserved and cannot be used.
37# * Declarations can be done conditionally by use of a
38#     +if <boolean_variable>
39#
40#     +else
41#
42#     +endif
43#   or a
44#     +ifnot <boolean_variable>
45#
46#     +else
47#
48#     +endif
49#   construct (else branches are optional). The boolean variable X is
50#   true after a "+enable X" statement or if it has been passed as a
51#   command line argument to make_alloc_types. The variable X is false
52#   after a "+disable X" statement or if it has never been mentioned.
53#
54# IMPORTANT! Only use 7-bit ascii text in this file!
55
56
57# --- Allocator declarations -------------------------------------------------
58#
59# If, and only if, the same thread performs *all* allocations,
60# reallocations and deallocations of all memory types that are handled
61# by a specific allocator (<ALLOCATOR> in type declaration), set
62# <MULTI_THREAD> for this specific allocator to false; otherwise, set
63# it to true.
64#
65# Syntax: allocator <ALLOCATOR> <MULTI_THREAD> <DESCRIPTION>
66#
67#		<ALLOCATOR>	<MULTI_THREAD>	<DESCRIPTION>
68
69allocator	SYSTEM		true		sys_alloc
70
71allocator	TEMPORARY	true		temp_alloc
72allocator	SHORT_LIVED	true		sl_alloc
73allocator	STANDARD	true		std_alloc
74allocator	LONG_LIVED	true		ll_alloc
75allocator	EHEAP		true		eheap_alloc
76allocator	ETS		true		ets_alloc
77allocator	FIXED_SIZE	true		fix_alloc
78allocator	LITERAL 	true		literal_alloc
79+if exec_alloc
80allocator	EXEC     	true	        exec_alloc
81+endif
82
83allocator	BINARY		true		binary_alloc
84allocator	DRIVER		true		driver_alloc
85
86allocator	TEST            true            test_alloc
87
88# --- Class declarations -----------------------------------------------------
89#
90# Syntax: class <CLASS> <DESCRIPTION>
91#
92#	<CLASS>		<DESCRIPTION>
93
94class	PROCESSES	process_data
95class	ATOM		atom_data
96class	CODE		code_data
97class	ETS		ets_data
98class	BINARIES	binary_data
99class	SYSTEM		system_data
100
101# --- Type declarations ------------------------------------------------------
102#
103# Syntax: type <TYPE> <ALLOCATOR> <CLASS> <DESCRIPTION>
104#
105# Use ERTS_ALC_T_<TYPE> as first parameter to erts_alloc(), erts_alloc_fnf(),
106# erts_realloc(), erts_realloc_fnf() or erts_free() in order to allocate,
107# reallocate or deallocate a memory block of type <TYPE>.
108#
109# NOTE: Only use temp_alloc for memory types that *really* are *temporarily*
110#	allocated. A good thumb rule: all memory allocated by temp_alloc
111#       should be deallocated before the emulator starts executing Erlang
112#       code again.
113#
114#	<TYPE>		<ALLOCATOR>	<CLASS>		<DESCRIPTION>
115
116type	PROC		FIXED_SIZE	PROCESSES	proc
117type	PORT		DRIVER		SYSTEM		port
118type	ATOM		LONG_LIVED	ATOM		atom_entry
119type	MODULE		LONG_LIVED	CODE		module_entry
120type	REG_PROC	STANDARD	PROCESSES	reg_proc
121type	PROC_LIST	SHORT_LIVED	PROCESSES	proc_list
122type	SAVED_ESTACK	SHORT_LIVED	PROCESSES	saved_estack
123type	FUN_ENTRY	LONG_LIVED	CODE		fun_entry
124type	ATOM_TXT	LONG_LIVED	ATOM		atom_text
125type 	BEAM_REGISTER	EHEAP		PROCESSES	beam_register
126type	HEAP		EHEAP		PROCESSES	heap
127type	OLD_HEAP	EHEAP		PROCESSES	old_heap
128type	HEAP_FRAG	EHEAP		PROCESSES	heap_frag
129type	TMP_HEAP	TEMPORARY	PROCESSES	tmp_heap
130type	MSG_REF		FIXED_SIZE	PROCESSES	msg_ref
131type	MSG		EHEAP		PROCESSES	message
132type	MSGQ_CHNG	SHORT_LIVED	PROCESSES	messages_queue_change
133type	ROOTSET		TEMPORARY	PROCESSES	root_set
134type	LOADER_TMP	TEMPORARY	CODE		loader_tmp
135type	PREPARED_CODE	SHORT_LIVED	CODE		prepared_code
136type	TIMER_SERVICE	LONG_LIVED	SYSTEM		timer_service
137type    LL_PTIMER	FIXED_SIZE	PROCESSES	ll_ptimer
138type    HL_PTIMER	FIXED_SIZE	PROCESSES	hl_ptimer
139type    BIF_TIMER	FIXED_SIZE	PROCESSES	bif_timer
140type    TIMER_REQUEST	SHORT_LIVED	PROCESSES	timer_request
141type    BTM_YIELD_STATE	SHORT_LIVED	PROCESSES	btm_yield_state
142type	REG_TABLE	STANDARD	SYSTEM		reg_tab
143type	FUN_TABLE	STANDARD	CODE		fun_tab
144type	DIST_TABLE	STANDARD	SYSTEM		dist_tab
145type	NODE_TABLE	STANDARD	SYSTEM		node_tab
146type	ATOM_TABLE	LONG_LIVED	ATOM		atom_tab
147type	EXPORT_TABLE	LONG_LIVED	CODE		export_tab
148type	MODULE_TABLE	LONG_LIVED	CODE		module_tab
149type	TAINT		LONG_LIVED	CODE		taint_list
150type	MODULE_REFS	STANDARD	CODE		module_refs
151type	NC_TMP		TEMPORARY	SYSTEM		nc_tmp
152type	NC_STD		STANDARD	SYSTEM		nc_std
153type	TMP		TEMPORARY	SYSTEM		tmp
154type	UNDEF		SYSTEM		SYSTEM		undefined
155type	DCACHE		STANDARD	SYSTEM		dcache
156type	DCTRL_BUF	TEMPORARY	SYSTEM		dctrl_buf
157type	DIST_ENTRY	STANDARD	SYSTEM		dist_entry
158type	NODE_ENTRY	STANDARD	SYSTEM		node_entry
159type	PROC_TABLE	LONG_LIVED	PROCESSES	proc_tab
160type	PORT_TABLE	LONG_LIVED	SYSTEM		port_tab
161type	TIMER_WHEEL	LONG_LIVED	SYSTEM		timer_wheel
162type	DRV		DRIVER		SYSTEM		drv_internal
163type	DRV_BINARY	BINARY		BINARIES	drv_binary
164type	DRIVER		DRIVER		SYSTEM		driver
165type	DRV_CMD_DATA	DRIVER		SYSTEM		driver_command_data
166type	DRV_CTRL_DATA	DRIVER		SYSTEM		driver_control_data
167type	DRV_CALL_DATA	DRIVER		SYSTEM		driver_call_data
168type	NIF		DRIVER		SYSTEM		nif_internal
169type	BINARY		BINARY		BINARIES	binary
170type	NBIF_TABLE	SYSTEM		SYSTEM		nbif_tab
171type	ARG_REG		STANDARD	PROCESSES	arg_reg
172type	PROC_DICT	STANDARD	PROCESSES	proc_dict
173type	CALLS_BUF	STANDARD	PROCESSES	calls_buf
174type	BPD		STANDARD	SYSTEM		bpd
175type	LINEBUF		STANDARD	SYSTEM		line_buf
176type	IOQ		STANDARD	SYSTEM		io_queue
177type	BITS_BUF	STANDARD	SYSTEM		bits_buf
178type	ASYNC_DATA	LONG_LIVED	SYSTEM		internal_async_data
179type	ESTACK		TEMPORARY	SYSTEM		estack
180type	DB_TABLE	ETS		ETS		db_tab
181type	DB_FIXATION	SHORT_LIVED	ETS		db_fixation
182type	DB_FIX_DEL	SHORT_LIVED	ETS		fixed_del
183type	DB_TABLES	LONG_LIVED	ETS		db_tabs
184type    DB_NTAB_ENT	STANDARD	ETS		db_named_table_entry
185type	DB_TMP		TEMPORARY	ETS		db_tmp
186type	DB_MC_STK	TEMPORARY	ETS		db_mc_stack
187type	DB_MS_RUN_HEAP	SHORT_LIVED	ETS		db_match_spec_run_heap
188type	DB_MS_CMPL_HEAP	TEMPORARY	ETS		db_match_spec_cmpl_heap
189type	DB_SEG		ETS		ETS		db_segment
190type	DB_STK		ETS		ETS		db_stack
191type	DB_TRANS_TAB	ETS		ETS		db_trans_tab
192type	DB_SEL_LIST	ETS		ETS		db_select_list
193type	DB_DMC_ERROR	ETS		ETS		db_dmc_error
194type	DB_DMC_ERR_INFO	ETS		ETS		db_dmc_error_info
195type	DB_TERM		ETS		ETS		db_term
196type	DB_PROC_CLEANUP SHORT_LIVED	ETS		db_proc_cleanup_state
197type	ETS_ALL_REQ	SHORT_LIVED	ETS		ets_all_request
198type	ETS_CTRS	ETS             ETS		ets_decentralized_ctrs
199type	ETS_I_LST_TRAP	SHORT_LIVED	ETS		ets_insert_list_bif_trap_state
200type	LOGGER_DSBUF	TEMPORARY	SYSTEM		logger_dsbuf
201type	TMP_DSBUF	TEMPORARY	SYSTEM		tmp_dsbuf
202type	INFO_DSBUF	SYSTEM		SYSTEM		info_dsbuf
203# INFO_DSBUF have to use the SYSTEM allocator; otherwise, a deadlock might occur
204type	SCHDLR_SLP_INFO	LONG_LIVED	SYSTEM		scheduler_sleep_info
205type	RUNQS		LONG_LIVED	SYSTEM		run_queues
206type	DDLL_HANDLE	STANDARD	SYSTEM		ddll_handle
207type	DDLL_ERRCODES	LONG_LIVED	SYSTEM		ddll_errcodes
208type	DDLL_TMP_BUF	TEMPORARY	SYSTEM		ddll_tmp_buf
209type	PORT_TASK	SHORT_LIVED	SYSTEM		port_task
210type	PT_HNDL_LIST	SHORT_LIVED	SYSTEM		port_task_handle_list
211type	MISC_OP_LIST	SHORT_LIVED	SYSTEM		misc_op_list
212type	PORT_NAMES	SHORT_LIVED	SYSTEM		port_names
213type	PORT_DATA_LOCK	DRIVER		SYSTEM		port_data_lock
214type	PTAB_LIST_DEL	SHORT_LIVED	PROCESSES	ptab_list_deleted_el
215type	PTAB_LIST_CNKI	SHORT_LIVED	PROCESSES	ptab_list_chunk_info
216type	PTAB_LIST_PIDS	SHORT_LIVED	PROCESSES	ptab_list_pids
217type	RE_TMP_BUF	TEMPORARY	SYSTEM		re_tmp_buf
218type    RE_SUBJECT      SHORT_LIVED     SYSTEM          re_subject
219type  	RE_HEAP 	STANDARD	SYSTEM		re_heap
220type	RE_STACK 	SHORT_LIVED	SYSTEM		re_stack
221type	UNICODE_BUFFER 	SHORT_LIVED	SYSTEM		unicode_buffer
222type	BINARY_BUFFER 	SHORT_LIVED	SYSTEM		binary_buffer
223type	PRE_ALLOC_DATA	LONG_LIVED	SYSTEM		pre_alloc_data
224type	DRV_THR_OPTS	DRIVER		SYSTEM		driver_thread_opts
225type	DRV_TID		DRIVER		SYSTEM		driver_tid
226type	DRV_MTX		DRIVER		SYSTEM		driver_mutex
227type	DRV_CND		DRIVER		SYSTEM		driver_cond
228type	DRV_RWLCK	DRIVER		SYSTEM		driver_rwlock
229type	DRV_TSD		DRIVER		SYSTEM		driver_tsd
230type	PSD		STANDARD	PROCESSES	process_specific_data
231type	PRTSD		STANDARD	SYSTEM		port_specific_data
232type	CPUDATA		LONG_LIVED	SYSTEM		cpu_data
233type	TMP_CPU_IDS	SHORT_LIVED	SYSTEM		tmp_cpu_ids
234type	EXT_TERM_DATA	SHORT_LIVED	PROCESSES	external_term_data
235type	CPU_GRPS_MAP	LONG_LIVED	SYSTEM		cpu_groups_map
236type	MISC_AUX_WORK_Q	LONG_LIVED	SYSTEM		misc_aux_work_q
237type	CODE_IX_LOCK_Q  SHORT_LIVED	SYSTEM		code_ix_lock_q
238type    BUSY_CALLER_TAB	SHORT_LIVED	SYSTEM		busy_caller_table
239type    BUSY_CALLER	SHORT_LIVED	SYSTEM		busy_caller
240type	PROC_SYS_TSK	SHORT_LIVED	PROCESSES	proc_sys_task
241type	PROC_SYS_TSK_QS	SHORT_LIVED	PROCESSES	proc_sys_task_queues
242type    NEW_TIME_OFFSET	SHORT_LIVED	SYSTEM		new_time_offset
243type	IOB_REQ		SHORT_LIVED	SYSTEM		io_bytes_request
244type    TRACER_NIF      LONG_LIVED      SYSTEM          tracer_nif
245type    TRACE_MSG_QUEUE SHORT_LIVED     SYSTEM          trace_message_queue
246type    DIRTY_SL	SHORT_LIVED	SYSTEM		dirty_short_lived
247type    MREF_NSCHED_ENT	FIXED_SIZE	SYSTEM		nsched_magic_ref_entry
248type    MREF_ENT	STANDARD	SYSTEM		magic_ref_entry
249type	MREF_TAB_BKTS	STANDARD	SYSTEM		magic_ref_table_buckets
250type	MREF_TAB	LONG_LIVED	SYSTEM		magic_ref_table
251type	MINDIRECTION	FIXED_SIZE	SYSTEM		magic_indirection
252type	BINARY_FIND	SHORT_LIVED	PROCESSES	binary_find
253type	CRASH_DUMP	STANDARD	SYSTEM		crash_dump
254type	DIST_TRANSCODE  SHORT_LIVED	SYSTEM		dist_transcode_context
255type	RLA_BLOCK_CNTRS	LONG_LIVED	SYSTEM		release_literal_area_block_counters
256
257type	THR_Q_EL	STANDARD   	SYSTEM		thr_q_element
258type	THR_Q_EL_SL	FIXED_SIZE	SYSTEM		sl_thr_q_element
259type	MISC_AUX_WORK	SHORT_LIVED	SYSTEM		misc_aux_work
260type	THR_Q		STANDARD	SYSTEM		thr_queue
261type	THR_Q_SL	SHORT_LIVED	SYSTEM		short_lived_thr_queue
262type	THR_Q_LL	LONG_LIVED	SYSTEM		long_lived_thr_queue
263
264type	ASYNC		SHORT_LIVED	SYSTEM		async
265type	ZLIB		STANDARD	SYSTEM		zlib
266
267type	DRIVER_LOCK	STANDARD	SYSTEM		driver_lock
268type	XPORTS_LIST	SHORT_LIVED	SYSTEM		extra_port_list
269type	RUNQ_BLNS	LONG_LIVED	SYSTEM		run_queue_balancing
270type	THR_PRGR_IDATA	LONG_LIVED	SYSTEM		thr_prgr_internal_data
271type	THR_PRGR_DATA	LONG_LIVED	SYSTEM		thr_prgr_data
272type	T_THR_PRGR_DATA	SHORT_LIVED	SYSTEM		temp_thr_prgr_data
273type	RELEASE_LAREA	SHORT_LIVED	SYSTEM		release_literal_area
274type	SIG_DATA	SHORT_LIVED	PROCESSES	signal_data
275type	DIST_DEMONITOR	SHORT_LIVED	PROCESSES	dist_demonitor
276type	CML_CLEANUP	SHORT_LIVED	SYSTEM		connection_ml_cleanup
277type	ML_YIELD_STATE	SHORT_LIVED	SYSTEM		monitor_link_yield_state
278type	ML_DIST		STANDARD	SYSTEM		monitor_link_dist
279type	PF3_ARGS	SHORT_LIVED	PROCESSES	process_flag_3_arguments
280type	SETUP_CONN_ARG	SHORT_LIVED	PROCESSES	setup_connection_argument
281type    LIST_TRAP       SHORT_LIVED     PROCESSES       list_bif_trap_state
282type    CONT_EXIT_TRAP  SHORT_LIVED     PROCESSES       continue_exit_trap_state
283type    SEQ_YIELD_STATE SHORT_LIVED     SYSTEM          dist_seq_yield_state
284type    PHASH2_TRAP     SHORT_LIVED     PROCESSES       phash2_trap_state
285
286type	ENVIRONMENT	SYSTEM		SYSTEM		environment
287
288type	PERSISTENT_TERM	LONG_LIVED	CODE		persisten_term
289type	PERSISTENT_LOCK_Q SHORT_LIVED	SYSTEM		persistent_lock_q
290type	PERSISTENT_TERM_TMP SHORT_LIVED	SYSTEM		persistent_term_tmp_table
291
292type	T2B_VEC	  	SHORT_LIVED	PROCESSES	term_to_binary_vector
293
294#
295# Types used for special emulators
296#
297
298type	ETHR_STD	STANDARD	SYSTEM		ethread_standard
299type	ETHR_SL		SHORT_LIVED	SYSTEM		ethread_short_lived
300type	ETHR_LL		LONG_LIVED	SYSTEM		ethread_long_lived
301
302type	SYS_MSG_Q	SHORT_LIVED	PROCESSES	system_messages_queue
303type	FP_EXCEPTION	LONG_LIVED	SYSTEM		fp_exception
304type	LL_MPATHS	LONG_LIVED	SYSTEM		ll_migration_paths
305type	SL_MPATHS	SHORT_LIVED	SYSTEM		sl_migration_paths
306
307+if hipe
308
309type	HIPE_LL		LONG_LIVED	SYSTEM		hipe_long_lived
310type	HIPE_SL		SHORT_LIVED	SYSTEM		hipe_short_lived
311type	HIPE_STK	STANDARD	SYSTEM		hipe_nstack
312
313+if exec_alloc
314type	HIPE_EXEC	EXEC            CODE		hipe_code
315+endif
316
317+endif
318
319+if lcnt
320
321type    LCNT_CARRIER   STANDARD    SYSTEM  lcnt_lock_info_carrier
322type    LCNT_VECTOR SHORT_LIVED SYSTEM lcnt_sample_vector
323
324+endif
325
326type	DEBUG	        SHORT_LIVED	SYSTEM          debugging
327
328type	DDLL_PROCESS	STANDARD	SYSTEM		ddll_processes
329type	MONITOR_EXT	STANDARD	PROCESSES	monitor_extended
330type	LINK_EXT	STANDARD	PROCESSES	link_extended
331type	CODE		LONG_LIVED	CODE		code
332type	LITERAL		LITERAL 	CODE		literal
333type	LITERAL_REF	SHORT_LIVED	CODE		literal_area_ref
334type	PURGE_DATA	SHORT_LIVED	CODE		purge_data
335type	DB_HEIR_DATA	STANDARD	ETS		db_heir_data
336type	DB_MS_PSDO_PROC	LONG_LIVED	ETS		db_match_pseudo_proc
337type	SCHDLR_DATA	LONG_LIVED	SYSTEM		scheduler_data
338
339type	NFUNC_TRAP_WRAPPER	STANDARD	PROCESSES	nfunc_trap_wrapper
340type	EXPORT		LONG_LIVED	CODE		export_entry
341type	MONITOR		FIXED_SIZE	PROCESSES	monitor
342type	MONITOR_SUSPEND	STANDARD	PROCESSES	monitor_suspend
343type	LINK		FIXED_SIZE	PROCESSES	link
344type	AINFO_REQ	SHORT_LIVED	SYSTEM		alloc_info_request
345type	SCHED_WTIME_REQ	SHORT_LIVED	SYSTEM		sched_wall_time_request
346type	GC_INFO_REQ	SHORT_LIVED	SYSTEM		gc_info_request
347type	PORT_DATA_HEAP	STANDARD	SYSTEM		port_data_heap
348type    MSACC           DRIVER          SYSTEM          microstate_accounting
349type	SYS_CHECK_REQ	SHORT_LIVED	SYSTEM		system_check_request
350type	ATOMICS		STANDARD	SYSTEM		erl_bif_atomics
351type	COUNTERS	STANDARD	SYSTEM		erl_bif_counters
352
353#
354# Types used by system specific code
355#
356
357type  	TEMP_TERM       TEMPORARY	SYSTEM		temp_term
358type  	SHORT_LIVED_TERM SHORT_LIVED	SYSTEM		short_lived_term
359type	DRV_TAB		LONG_LIVED	SYSTEM		drv_tab
360type	DRV_EV_STATE	LONG_LIVED	SYSTEM		driver_event_state
361type	DRV_SEL_D_STATE	FIXED_SIZE	SYSTEM		driver_select_data_state
362type	NIF_SEL_D_STATE	FIXED_SIZE	SYSTEM		enif_select_data_state
363type	POLLSET		LONG_LIVED	SYSTEM		pollset
364type	POLLSET_UPDREQ	SHORT_LIVED	SYSTEM		pollset_update_req
365type	POLL_FDS	LONG_LIVED	SYSTEM		poll_fds
366type	BLOCK_PTHR_DATA	LONG_LIVED	SYSTEM		block_poll_thread_data
367type	FD_STATUS	LONG_LIVED	SYSTEM		fd_status
368type	SELECT_FDS	LONG_LIVED	SYSTEM		select_fds
369
370+if unix
371
372type	SYS_READ_BUF	TEMPORARY	SYSTEM		sys_read_buf
373type	FD_ENTRY_BUF	STANDARD	SYSTEM		fd_entry_buf
374type	CS_PROG_PATH	LONG_LIVED	SYSTEM		cs_prog_path
375type	SYS_BLOCKING	STANDARD	SYSTEM		sys_blocking
376
377type	SYS_WRITE_BUF	TEMPORARY	SYSTEM		sys_write_buf
378
379+endif
380
381+if win32
382
383type	DRV_DATA_BUF	SYSTEM		SYSTEM		drv_data_buf
384type	PRELOADED	LONG_LIVED	SYSTEM		preloaded
385type	WAITER_OBJ	LONG_LIVED	SYSTEM		waiter_object
386
387+endif
388
389# This type should only be used for test
390type	TEST		TEST		SYSTEM		testing
391
392# ----------------------------------------------------------------------------
393