+ return GC_get_free_bytes();
+}
+
+
+s8 gc_get_max_heap_size(void)
+{
+ return GC_get_max_heap_size();
+}
+
+
+void gc_invoke_finalizers(void)
+{
+ GC_invoke_finalizers();
+}
+
+
+void gc_finalize_all(void)
+{
+ GC_finalize_all();
+}
+
+
+/* gc_out_of_memory ************************************************************
+
+ This function is called when boehm detects that it is OOM.
+
+*******************************************************************************/
+
+void *gc_out_of_memory(size_t bytes_requested)
+{
+ /* if this happens, we are REALLY out of memory */
+
+ if (in_gc_out_of_memory) {
+ /* this is all we can do... */
+ throw_cacao_exception_exit(string_java_lang_InternalError,
+ "Out of memory");
+ }
+
+ in_gc_out_of_memory = true;
+
+ /* try to release some memory */
+
+ gc_call();
+
+ /* now instantiate the exception */
+
+ *exceptionptr = new_exception(string_java_lang_OutOfMemoryError);
+
+ in_gc_out_of_memory = false;
+
+ return NULL;