lib: adds a method to force invocation of garbage collector
[nit.git] / clib / gc.c
index 19f2d9e..eb9df80 100644 (file)
--- a/clib/gc.c
+++ b/clib/gc.c
@@ -245,3 +245,7 @@ void GC_add_static_object(val_t *pointer) {
        GC_List_Push(&staticObjects, pointer);
 }
 
+/* Is invoked by intern method Sys:force_garbage_collection */
+void Nit_gc_force_garbage_collection( void ) {
+       GC_enlarge_and_collect( 0 );
+}