File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -296,6 +296,12 @@ int main(int argc, char** argv)
296296
297297 PUSH ("+sbtu" );
298298 PUSH ("+A0" );
299+
300+ /* Avoid wasting memory for processes and ports that will never be
301+ * used. */
302+ PUSH2 ("+P" , "65536" );
303+ PUSH2 ("+Q" , "1024" );
304+
299305 PUSH ("-noinput" );
300306 PUSH2 ("-mode" , "minimal" );
301307 PUSH2 ("-boot" , "no_dot_erlang" );
@@ -960,7 +966,13 @@ start_compile_server(char* node_name, char** argv)
960966 char * progname = argv [0 ];
961967
962968 while (strcmp (argv [0 ], "-mode" ) != 0 ) {
963- eargv [eargc ++ ] = * argv ++ ;
969+ if (strcmp (argv [0 ], "+P" ) == 0 || strcmp (argv [0 ], "+Q" ) == 0 ) {
970+ /* We don't want to limit the number of ports and
971+ * processes for the compile server. */
972+ argv += 2 ;
973+ } else {
974+ eargv [eargc ++ ] = * argv ++ ;
975+ }
964976 }
965977 PUSH2 ("-boot" , "no_dot_erlang" );
966978 PUSH2 ("-sname" , node_name );
You can’t perform that action at this time.
0 commit comments