nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
a_star: don't crash on deserialization errors and limit static types
[nit.git]
/
clib
/
gc_chooser.c
diff --git
a/clib/gc_chooser.c
b/clib/gc_chooser.c
index
ca06552
..
5cf3065
100644
(file)
--- a/
clib/gc_chooser.c
+++ b/
clib/gc_chooser.c
@@
-18,6
+18,9
@@
#ifdef ANDROID
#include <android/log.h>
#define PRINT_ERROR(...) ((void)__android_log_print(ANDROID_LOG_WARN, "nit", __VA_ARGS__))
#ifdef ANDROID
#include <android/log.h>
#define PRINT_ERROR(...) ((void)__android_log_print(ANDROID_LOG_WARN, "nit", __VA_ARGS__))
+
+ // FIXME bring back when the GC is fixed in Android
+ #undef WITH_LIBGC
#else
#define PRINT_ERROR(...) ((void)fprintf(stderr, __VA_ARGS__))
#endif
#else
#define PRINT_ERROR(...) ((void)fprintf(stderr, __VA_ARGS__))
#endif
@@
-61,6
+64,7
@@
void nit_gcollect(void) {
#ifdef WITH_LIBGC
case gc_opt_boehm: GC_gcollect(); break;
#endif
#ifdef WITH_LIBGC
case gc_opt_boehm: GC_gcollect(); break;
#endif
+ default: break; /* nothing can be done */
}
}
}
}
@@
-120,3
+124,11
@@
void initialize_gc_option(void) {
default: break; /* Nothing */
}
}
default: break; /* Nothing */
}
}
+
+void gc_register_finalizer(void* obj) {
+#ifdef WITH_LIBGC
+ GC_register_finalizer_no_order(obj, &gc_finalize, NULL, NULL, NULL);
+#endif
+}
+
+void __attribute__((weak)) gc_finalize(void *obj, void* client_data) {}