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
80allocator	BINARY		true		binary_alloc
81allocator	DRIVER		true		driver_alloc
82
83allocator	TEST            true            test_alloc
84
85# --- Class declarations -----------------------------------------------------
86#
87# Syntax: class <CLASS> <DESCRIPTION>
88#
89#	<CLASS>		<DESCRIPTION>
90
91class	PROCESSES	process_data
92class	ATOM		atom_data
93class	CODE		code_data
94class	ETS		ets_data
95class	BINARIES	binary_data
96class	SYSTEM		system_data
97
98# --- Type declarations ------------------------------------------------------
99#
100# Syntax: type <TYPE> <ALLOCATOR> <CLASS> <DESCRIPTION>
101#
102# Use ERTS_ALC_T_<TYPE> as first parameter to erts_alloc(), erts_alloc_fnf(),
103# erts_realloc(), erts_realloc_fnf() or erts_free() in order to allocate,
104# reallocate or deallocate a memory block of type <TYPE>.
105#
106# NOTE: Only use temp_alloc for memory types that *really* are *temporarily*
107#	allocated. A good thumb rule: all memory allocated by temp_alloc
108#       should be deallocated before the emulator starts executing Erlang
109#       code again.
110#
111#	<TYPE>		<ALLOCATOR>	<CLASS>		<DESCRIPTION>
112
113type	PROC		FIXED_SIZE	PROCESSES	proc
114type	PORT		DRIVER		SYSTEM		port
115type	ATOM		LONG_LIVED	ATOM		atom_entry
116type	MODULE		LONG_LIVED	CODE		module_entry
117type	REG_PROC	STANDARD	PROCESSES	reg_proc
118type	PROC_LIST	SHORT_LIVED	PROCESSES	proc_list
119type	SAVED_ESTACK	SHORT_LIVED	PROCESSES	saved_estack
120type	FUN_ENTRY	LONG_LIVED	CODE		fun_entry
121type	ATOM_TXT	LONG_LIVED	ATOM		atom_text
122type 	BEAM_REGISTER	EHEAP		PROCESSES	beam_register
123type	HEAP		EHEAP		PROCESSES	heap
124type	OLD_HEAP	EHEAP		PROCESSES	old_heap
125type	HEAP_FRAG	EHEAP		PROCESSES	heap_frag
126type	TMP_HEAP	TEMPORARY	PROCESSES	tmp_heap
127type	RECV_MARK_BLK	FIXED_SIZE	PROCESSES	receive_marker_block
128type	MSG_REF		FIXED_SIZE	PROCESSES	msg_ref
129type	MSG		EHEAP		PROCESSES	message
130type	MSGQ_CHNG	SHORT_LIVED	PROCESSES	messages_queue_change
131type	ROOTSET		TEMPORARY	PROCESSES	root_set
132type	LOADER_TMP	TEMPORARY	CODE		loader_tmp
133type	PREPARED_CODE	SHORT_LIVED	CODE		prepared_code
134type	TIMER_SERVICE	LONG_LIVED	SYSTEM		timer_service
135type    LL_PTIMER	FIXED_SIZE	PROCESSES	ll_ptimer
136type    HL_PTIMER	FIXED_SIZE	PROCESSES	hl_ptimer
137type    BIF_TIMER	FIXED_SIZE	PROCESSES	bif_timer
138type    TIMER_REQUEST	SHORT_LIVED	PROCESSES	timer_request
139type    BTM_YIELD_STATE	SHORT_LIVED	PROCESSES	btm_yield_state
140type	REG_TABLE	STANDARD	SYSTEM		reg_tab
141type	FUN_TABLE	STANDARD	CODE		fun_tab
142type	DIST_TABLE	STANDARD	SYSTEM		dist_tab
143type	NODE_TABLE	STANDARD	SYSTEM		node_tab
144type	ATOM_TABLE	LONG_LIVED	ATOM		atom_tab
145type	MODULE_TABLE	LONG_LIVED	CODE		module_tab
146type	TAINT		LONG_LIVED	CODE		taint_list
147type	MODULE_REFS	STANDARD	CODE		module_refs
148type	NC_TMP		TEMPORARY	SYSTEM		nc_tmp
149type	NC_STD		STANDARD	SYSTEM		nc_std
150type	TMP		TEMPORARY	SYSTEM		tmp
151type	UNDEF		SYSTEM		SYSTEM		undefined
152type	DCACHE		STANDARD	SYSTEM		dcache
153type	DCTRL_BUF	TEMPORARY	SYSTEM		dctrl_buf
154type	DIST_ENTRY	STANDARD	SYSTEM		dist_entry
155type	NODE_ENTRY	STANDARD	SYSTEM		node_entry
156type	PROC_TABLE	LONG_LIVED	PROCESSES	proc_tab
157type	PORT_TABLE	LONG_LIVED	SYSTEM		port_tab
158type	TIMER_WHEEL	LONG_LIVED	SYSTEM		timer_wheel
159type	DRV		DRIVER		SYSTEM		drv_internal
160type	DRV_BINARY	BINARY		BINARIES	drv_binary
161type	DRIVER		DRIVER		SYSTEM		driver
162type	DRV_CMD_DATA	DRIVER		SYSTEM		driver_command_data
163type	DRV_CTRL_DATA	DRIVER		SYSTEM		driver_control_data
164type	DRV_CALL_DATA	DRIVER		SYSTEM		driver_call_data
165type	NIF		DRIVER		SYSTEM		nif_internal
166type	BINARY		BINARY		BINARIES	binary
167type	NBIF_TABLE	SYSTEM		SYSTEM		nbif_tab
168type	ARG_REG		STANDARD	PROCESSES	arg_reg
169type	PROC_DICT	STANDARD	PROCESSES	proc_dict
170type	CALLS_BUF	STANDARD	PROCESSES	calls_buf
171type	BPD		STANDARD	SYSTEM		bpd
172type	LINEBUF		STANDARD	SYSTEM		line_buf
173type	IOQ		STANDARD	SYSTEM		io_queue
174type	BITS_BUF	STANDARD	SYSTEM		bits_buf
175type	ASYNC_DATA	LONG_LIVED	SYSTEM		internal_async_data
176type	ESTACK		TEMPORARY	SYSTEM		estack
177type	DB_TABLE	ETS		ETS		db_tab
178type	DB_FIXATION	SHORT_LIVED	ETS		db_fixation
179type	DB_FIX_DEL	SHORT_LIVED	ETS		fixed_del
180type	DB_TABLES	LONG_LIVED	ETS		db_tabs
181type    DB_NTAB_ENT	STANDARD	ETS		db_named_table_entry
182type	DB_TMP		TEMPORARY	ETS		db_tmp
183type	DB_MC_STK	TEMPORARY	ETS		db_mc_stack
184type	DB_MS_RUN_HEAP	SHORT_LIVED	ETS		db_match_spec_run_heap
185type	DB_MS_CMPL_HEAP	TEMPORARY	ETS		db_match_spec_cmpl_heap
186type	DB_SEG		ETS		ETS		db_segment
187type	DB_STK		ETS		ETS		db_stack
188type	DB_TRANS_TAB	ETS		ETS		db_trans_tab
189type	DB_SEL_LIST	ETS		ETS		db_select_list
190type	DB_DMC_ERROR	ETS		ETS		db_dmc_error
191type	DB_DMC_ERR_INFO	ETS		ETS		db_dmc_error_info
192type	DB_TERM		ETS		ETS		db_term
193type	DB_PROC_CLEANUP SHORT_LIVED	ETS		db_proc_cleanup_state
194type	ETS_ALL_REQ	SHORT_LIVED	ETS		ets_all_request
195type	ETS_CTRS	ETS             ETS		ets_decentralized_ctrs
196type	ETS_I_LST_TRAP	SHORT_LIVED	ETS		ets_insert_list_bif_trap_state
197type	LOGGER_DSBUF	TEMPORARY	SYSTEM		logger_dsbuf
198type	TMP_DSBUF	TEMPORARY	SYSTEM		tmp_dsbuf
199type	INFO_DSBUF	SYSTEM		SYSTEM		info_dsbuf
200# INFO_DSBUF have to use the SYSTEM allocator; otherwise, a deadlock might occur
201type	SCHDLR_SLP_INFO	LONG_LIVED	SYSTEM		scheduler_sleep_info
202type	RUNQS		LONG_LIVED	SYSTEM		run_queues
203type	DDLL_HANDLE	STANDARD	SYSTEM		ddll_handle
204type	DDLL_ERRCODES	LONG_LIVED	SYSTEM		ddll_errcodes
205type	DDLL_TMP_BUF	TEMPORARY	SYSTEM		ddll_tmp_buf
206type	PORT_TASK	SHORT_LIVED	SYSTEM		port_task
207type	PT_HNDL_LIST	SHORT_LIVED	SYSTEM		port_task_handle_list
208type	MISC_OP_LIST	SHORT_LIVED	SYSTEM		misc_op_list
209type	PORT_NAMES	SHORT_LIVED	SYSTEM		port_names
210type	PORT_DATA_LOCK	DRIVER		SYSTEM		port_data_lock
211type	PTAB_LIST_DEL	SHORT_LIVED	PROCESSES	ptab_list_deleted_el
212type	PTAB_LIST_CNKI	SHORT_LIVED	PROCESSES	ptab_list_chunk_info
213type	PTAB_LIST_PIDS	SHORT_LIVED	PROCESSES	ptab_list_pids
214type	RE_TMP_BUF	TEMPORARY	SYSTEM		re_tmp_buf
215type    RE_SUBJECT      SHORT_LIVED     SYSTEM          re_subject
216type  	RE_HEAP 	STANDARD	SYSTEM		re_heap
217type	RE_STACK 	SHORT_LIVED	SYSTEM		re_stack
218type	UNICODE_BUFFER 	SHORT_LIVED	SYSTEM		unicode_buffer
219type	BINARY_BUFFER 	SHORT_LIVED	SYSTEM		binary_buffer
220type	PRE_ALLOC_DATA	LONG_LIVED	SYSTEM		pre_alloc_data
221type	DRV_THR_OPTS	DRIVER		SYSTEM		driver_thread_opts
222type	DRV_TID		DRIVER		SYSTEM		driver_tid
223type	DRV_MTX		DRIVER		SYSTEM		driver_mutex
224type	DRV_CND		DRIVER		SYSTEM		driver_cond
225type	DRV_RWLCK	DRIVER		SYSTEM		driver_rwlock
226type	DRV_TSD		DRIVER		SYSTEM		driver_tsd
227type	PSD		STANDARD	PROCESSES	process_specific_data
228type	PRTSD		STANDARD	SYSTEM		port_specific_data
229type	CPUDATA		LONG_LIVED	SYSTEM		cpu_data
230type	TMP_CPU_IDS	SHORT_LIVED	SYSTEM		tmp_cpu_ids
231type	EXT_TERM_DATA	SHORT_LIVED	PROCESSES	external_term_data
232type	CPU_GRPS_MAP	LONG_LIVED	SYSTEM		cpu_groups_map
233type	MISC_AUX_WORK_Q	LONG_LIVED	SYSTEM		misc_aux_work_q
234type	CODE_IX_LOCK_Q  SHORT_LIVED	SYSTEM		code_ix_lock_q
235type    BUSY_CALLER_TAB	SHORT_LIVED	SYSTEM		busy_caller_table
236type    BUSY_CALLER	SHORT_LIVED	SYSTEM		busy_caller
237type	PROC_SYS_TSK	SHORT_LIVED	PROCESSES	proc_sys_task
238type	PROC_SYS_TSK_QS	SHORT_LIVED	PROCESSES	proc_sys_task_queues
239type    NEW_TIME_OFFSET	SHORT_LIVED	SYSTEM		new_time_offset
240type	IOB_REQ		SHORT_LIVED	SYSTEM		io_bytes_request
241type    TRACER_NIF      LONG_LIVED      SYSTEM          tracer_nif
242type    TRACE_MSG_QUEUE SHORT_LIVED     SYSTEM          trace_message_queue
243type    DIRTY_SL	SHORT_LIVED	SYSTEM		dirty_short_lived
244type    MREF_NSCHED_ENT	FIXED_SIZE	SYSTEM		nsched_magic_ref_entry
245type    MREF_ENT	STANDARD	SYSTEM		magic_ref_entry
246type	MREF_TAB_BKTS	STANDARD	SYSTEM		magic_ref_table_buckets
247type	MREF_TAB	LONG_LIVED	SYSTEM		magic_ref_table
248type    PREF_NSCHED_ENT	FIXED_SIZE	SYSTEM		nsched_pid_ref_entry
249type    PREF_ENT	STANDARD	SYSTEM		pid_ref_entry
250type	PREF_TAB_BKTS	STANDARD	SYSTEM		pid_ref_table_buckets
251type	PREF_TAB	LONG_LIVED	SYSTEM		pid_ref_table
252type	MINDIRECTION	FIXED_SIZE	SYSTEM		magic_indirection
253type	BINARY_FIND	SHORT_LIVED	PROCESSES	binary_find
254type	CRASH_DUMP	STANDARD	SYSTEM		crash_dump
255type	DIST_TRANSCODE  SHORT_LIVED	SYSTEM		dist_transcode_context
256type	RLA_BLOCK_CNTRS	LONG_LIVED	SYSTEM		release_literal_area_block_counters
257
258type	THR_Q_EL	STANDARD   	SYSTEM		thr_q_element
259type	THR_Q_EL_SL	FIXED_SIZE	SYSTEM		sl_thr_q_element
260type	MISC_AUX_WORK	SHORT_LIVED	SYSTEM		misc_aux_work
261type	THR_Q		STANDARD	SYSTEM		thr_queue
262type	THR_Q_SL	SHORT_LIVED	SYSTEM		short_lived_thr_queue
263type	THR_Q_LL	LONG_LIVED	SYSTEM		long_lived_thr_queue
264
265type	ASYNC		SHORT_LIVED	SYSTEM		async
266type	ZLIB		STANDARD	SYSTEM		zlib
267
268type	DRIVER_LOCK	STANDARD	SYSTEM		driver_lock
269type	XPORTS_LIST	SHORT_LIVED	SYSTEM		extra_port_list
270type	RUNQ_BLNS	LONG_LIVED	SYSTEM		run_queue_balancing
271type	THR_PRGR_IDATA	LONG_LIVED	SYSTEM		thr_prgr_internal_data
272type	THR_PRGR_DATA	LONG_LIVED	SYSTEM		thr_prgr_data
273type	T_THR_PRGR_DATA	SHORT_LIVED	SYSTEM		temp_thr_prgr_data
274type	RELEASE_LAREA	SHORT_LIVED	SYSTEM		release_literal_area
275type	SIG_DATA	SHORT_LIVED	PROCESSES	signal_data
276type	DIST_DEMONITOR	SHORT_LIVED	PROCESSES	dist_demonitor
277type	CML_CLEANUP	SHORT_LIVED	SYSTEM		connection_ml_cleanup
278type	ML_YIELD_STATE	SHORT_LIVED	SYSTEM		monitor_link_yield_state
279type	ML_DIST		STANDARD	SYSTEM		monitor_link_dist
280type	PF3_ARGS	SHORT_LIVED	PROCESSES	process_flag_3_arguments
281type	SETUP_CONN_ARG	SHORT_LIVED	PROCESSES	setup_connection_argument
282type    LIST_TRAP       SHORT_LIVED     PROCESSES       list_bif_trap_state
283type    CONT_EXIT_TRAP  SHORT_LIVED     PROCESSES       continue_exit_trap_state
284type    SEQ_YIELD_STATE SHORT_LIVED     SYSTEM          dist_seq_yield_state
285type    PHASH2_TRAP     SHORT_LIVED     PROCESSES       phash2_trap_state
286type    MAP_TRAP        SHORT_LIVED     PROCESSES       map_bif_trap_state
287
288type	ENVIRONMENT	SYSTEM		SYSTEM		environment
289
290type	PERSISTENT_TERM	LONG_LIVED	CODE		persisten_term
291type	PERSISTENT_LOCK_Q SHORT_LIVED	SYSTEM		persistent_lock_q
292type	PERSISTENT_TERM_TMP SHORT_LIVED	SYSTEM		persistent_term_tmp_table
293
294type	T2B_VEC	  	SHORT_LIVED	PROCESSES	term_to_binary_vector
295
296type	ETHR_STD	STANDARD	SYSTEM		ethread_standard
297type	ETHR_SL		SHORT_LIVED	SYSTEM		ethread_short_lived
298type	ETHR_LL		LONG_LIVED	SYSTEM		ethread_long_lived
299
300type	SYS_MSG_Q	SHORT_LIVED	PROCESSES	system_messages_queue
301type	FP_EXCEPTION	LONG_LIVED	SYSTEM		fp_exception
302type	LL_MPATHS	LONG_LIVED	SYSTEM		ll_migration_paths
303type	SL_MPATHS	SHORT_LIVED	SYSTEM		sl_migration_paths
304
305type	T2B_DETERMINISTIC SHORT_LIVED	PROCESSES	term_to_binary_deterministic
306
307#
308# Types used for special emulators
309#
310
311type	EXPORT_TABLE	LONG_LIVED	CODE		export_tab
312type	EXPORT		LONG_LIVED	CODE		export_entry
313type	CATCHES		LONG_LIVED	CODE		catches
314
315+ifnot beamasm
316type	CODE		LONG_LIVED	CODE		code
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	LITERAL		LITERAL 	CODE		literal
332type	LITERAL_REF	SHORT_LIVED	CODE		literal_area_ref
333type	PURGE_DATA	SHORT_LIVED	CODE		purge_data
334type	DB_HEIR_DATA	STANDARD	ETS		db_heir_data
335type	DB_MS_PSDO_PROC	LONG_LIVED	ETS		db_match_pseudo_proc
336type	SCHDLR_DATA	LONG_LIVED	SYSTEM		scheduler_data
337
338type	NFUNC_TRAP_WRAPPER	STANDARD	PROCESSES	nfunc_trap_wrapper
339type	MONITOR		FIXED_SIZE	PROCESSES	monitor
340type	MONITOR_TAG	STANDARD	PROCESSES	monitor_tag
341type	ALIAS		STANDARD	PROCESSES	alias
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