+ size_t heapcurrentsize;
+
+ GC_INIT();
+
+ /* set the maximal heap size */
+
+ GC_set_max_heap_size(heapmaxsize);
+
+ /* set the initial heap size */
+
+ heapcurrentsize = GC_get_heap_size();
+
+ if (heapstartsize > heapcurrentsize) {
+ GC_expand_hp(heapstartsize - heapcurrentsize);
+ }
+
+ /* define OOM function */
+
+ GC_oom_fn = gc_out_of_memory;
+
+ /* just to be sure (should be set to 1 by JAVA_FINALIZATION macro) */
+
+ GC_java_finalization = 1;
+
+ /* suppress warnings */
+
+ GC_set_warn_proc(gc_ignore_warnings);
+
+ /* install a GC notifier */
+
+ GC_finalize_on_demand = 1;
+ GC_finalizer_notifier = finalizer_notify;