1
0
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:
Larpon 2022-06-27 20:24:39 +02:00 committed by GitHub
parent b1a14c6cf7
commit 2d40ba1f49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 {