mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
cgen: call GC_INIT in sokol_main too, when compiling with -apk (#14869)
This commit is contained in:
parent
b1a14c6cf7
commit
2d40ba1f49
@ -138,10 +138,23 @@ void (_vsokol_cleanup_userdata_cb)(void* user_data) {
|
||||
}
|
||||
g.writeln('// The sokol_main entry point on Android
|
||||
sapp_desc sokol_main(int argc, char* argv[]) {
|
||||
(void)argc; (void)argv;
|
||||
(void)argc; (void)argv;')
|
||||
|
||||
_vinit(argc, (voidptr)argv);
|
||||
if g.pref.gc_mode in [.boehm_full, .boehm_incr, .boehm_full_opt, .boehm_incr_opt, .boehm_leak] {
|
||||
g.writeln('#if defined(_VGCBOEHM)')
|
||||
if g.pref.gc_mode == .boehm_leak {
|
||||
g.writeln('\tGC_set_find_leak(1);')
|
||||
}
|
||||
g.writeln('\tGC_set_pages_executable(0);')
|
||||
g.writeln('\tGC_INIT();')
|
||||
if g.pref.gc_mode in [.boehm_incr, .boehm_incr_opt] {
|
||||
g.writeln('\tGC_enable_incremental();')
|
||||
}
|
||||
g.writeln('#endif')
|
||||
}
|
||||
g.writeln('\t_vinit(argc, (voidptr)argv);
|
||||
')
|
||||
|
||||
g.gen_c_main_profile_hook()
|
||||
g.writeln('\tmain__main();')
|
||||
if g.is_autofree {
|
||||
|
Loading…
Reference in New Issue
Block a user