@@ -95,7 +95,9 @@ static void erl_init(int ncpu,
9595 int time_correction ,
9696 ErtsTimeWarpMode time_warp_mode ,
9797 int node_tab_delete_delay ,
98- ErtsDbSpinCount db_spin_count );
98+ ErtsDbSpinCount db_spin_count ,
99+ int module_tab_sz ,
100+ int export_tab_sz );
99101
100102static erts_atomic_t exiting ;
101103
@@ -255,7 +257,9 @@ erl_init(int ncpu,
255257 int time_correction ,
256258 ErtsTimeWarpMode time_warp_mode ,
257259 int node_tab_delete_delay ,
258- ErtsDbSpinCount db_spin_count )
260+ ErtsDbSpinCount db_spin_count ,
261+ int module_tab_sz ,
262+ int export_tab_sz )
259263{
260264 init_global_literals ();
261265 erts_monitor_link_init ();
@@ -283,9 +287,9 @@ erl_init(int ncpu,
283287 erts_code_ix_init ();
284288 erts_init_fun_table ();
285289 init_atom_table ();
286- init_export_table ();
290+ init_export_table (export_tab_sz );
287291 erts_record_init_table ();
288- init_module_table ();
292+ init_module_table (module_tab_sz );
289293 init_register_table ();
290294 init_message ();
291295#ifdef BEAMASM
@@ -1310,6 +1314,8 @@ erl_start(int argc, char **argv)
13101314 ErtsTimeWarpMode time_warp_mode ;
13111315 int node_tab_delete_delay = ERTS_NODE_TAB_DELAY_GC_DEFAULT ;
13121316 ErtsDbSpinCount db_spin_count = ERTS_DB_SPNCNT_NORMAL ;
1317+ int module_tab_sz = 0 ;
1318+ int export_tab_sz = 0 ;
13131319
13141320 /* Must be set up as early as possible for crash dump encryption to work
13151321 * properly. */
@@ -2446,6 +2452,32 @@ erl_start(int argc, char **argv)
24462452 erts_halt_flush_timeout = (ErtsMonotonicTime ) val ;
24472453 }
24482454 }
2455+ else if (has_prefix ("mml" , sub_param )) {
2456+ long val ;
2457+ char * endptr ;
2458+ arg = get_arg (sub_param + 3 , argv [i + 1 ], & i );
2459+ errno = 0 ;
2460+ val = strtol (arg , & endptr , 10 );
2461+ if (errno != 0 || * arg == '\0' || * endptr != '\0'
2462+ || val < 1 || MAX_SMALL < val || INT_MAX < val ) {
2463+ erts_fprintf (stderr , "Invalid module table limit %s\n" , arg );
2464+ erts_usage ();
2465+ }
2466+ module_tab_sz = (int ) val ;
2467+ }
2468+ else if (has_prefix ("mel" , sub_param )) {
2469+ long val ;
2470+ char * endptr ;
2471+ arg = get_arg (sub_param + 3 , argv [i + 1 ], & i );
2472+ errno = 0 ;
2473+ val = strtol (arg , & endptr , 10 );
2474+ if (errno != 0 || * arg == '\0' || * endptr != '\0'
2475+ || val < 1 || MAX_SMALL < val || INT_MAX < val ) {
2476+ erts_fprintf (stderr , "Invalid export table limit %s\n" , arg );
2477+ erts_usage ();
2478+ }
2479+ export_tab_sz = (int ) val ;
2480+ }
24492481 else {
24502482 erts_fprintf (stderr , "bad -z option %s\n" , argv [i ]);
24512483 erts_usage ();
@@ -2529,7 +2561,9 @@ erl_start(int argc, char **argv)
25292561 time_correction ,
25302562 time_warp_mode ,
25312563 node_tab_delete_delay ,
2532- db_spin_count );
2564+ db_spin_count ,
2565+ module_tab_sz ,
2566+ export_tab_sz );
25332567
25342568 load_preloaded ();
25352569 erts_end_staging_code_ix ();
0 commit comments