@@ -50,6 +50,7 @@ pub mut:
5050 is_shared_lib bool // Compile to shared library (.dylib/.so) for live reload
5151 no_optimize bool // -O0: skip SSA optimization (mem2reg, phi elimination)
5252 is_prod bool // -prod: use -O3 optimization for C compiler
53+ prealloc bool // -prealloc: use arena allocation (bump-pointer, not thread-safe)
5354 gc_mode GarbageCollectionMode // Garbage collection mode (-gc flag)
5455 backend Backend
5556 arch Arch = .auto
@@ -290,7 +291,7 @@ pub fn new_preferences_from_args(args []string) Preferences {
290291 '-nomarkused' , '--nomarkused' , '-showcc' , '--showcc' , '-stats' , '--stats' ,
291292 '-print-parsed-files' , '--print-parsed-files' , '-keepc' , '--profile-alloc' , '-profile-alloc' ,
292293 '-enable-globals' , '--enable-globals' , '-shared' , '--shared' , '-O0' , '--single-backend' ,
293- '-single-backend' , '-prod' ]
294+ '-single-backend' , '-prod' , '-prealloc' ]
294295 for opt in options {
295296 if opt ! in known_flags_with_values && opt ! in known_boolean_flags {
296297 eprintln ('error: unknown flag `${opt} `' )
@@ -308,6 +309,7 @@ pub fn new_preferences_from_args(args []string) Preferences {
308309 eprintln (' -d <name> Define a comptime flag' )
309310 eprintln (' -enable-globals Accepted for v1 compatibility' )
310311 eprintln (' -prod Production build: optimize with -O3 -flto' )
312+ eprintln (' -prealloc Use arena allocation (faster, not thread-safe)' )
311313 eprintln (' -O0 Skip SSA optimization (faster compile, slower code)' )
312314 eprintln (' --debug Enable debug mode' )
313315 eprintln (' -v, --verbose Enable verbose output' )
@@ -338,6 +340,7 @@ pub fn new_preferences_from_args(args []string) Preferences {
338340 is_shared_lib: '-shared' in options || '--shared' in options
339341 no_optimize: '-O0' in options
340342 is_prod: '-prod' in options
343+ prealloc: '-prealloc' in options
341344 single_backend: '--single-backend' in options || '-single-backend' in options
342345 gc_mode: gc_mode
343346 backend: backend
@@ -395,6 +398,7 @@ pub fn new_preferences_using_options(options []string) Preferences {
395398 is_shared_lib: '-shared' in options || '--shared' in options
396399 no_optimize: '-O0' in options
397400 is_prod: '-prod' in options
401+ prealloc: '-prealloc' in options
398402 single_backend: '--single-backend' in options || '-single-backend' in options
399403 backend: backend
400404 arch: arch
0 commit comments