aboutsummaryrefslogtreecommitdiff
path: root/system/include/gc.h
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-02-05 18:26:02 -0800
committerAlon Zakai <alonzakai@gmail.com>2013-02-05 18:26:02 -0800
commit5a99d2567e76f257309cfd225876f3a5402e5f46 (patch)
tree4017c62d53033d3cdfb1cdeb26529190d58784b2 /system/include/gc.h
parentac0972ebf6cb8ff17f1bbbf01526d29fd2d2f420 (diff)
parent9aa7bbf6987cad3cff53906c5d6a6e77b6bd5b9c (diff)
Merge branch 'incoming'
Diffstat (limited to 'system/include/gc.h')
-rw-r--r--system/include/gc.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/system/include/gc.h b/system/include/gc.h
index e0419dcb..a21fd410 100644
--- a/system/include/gc.h
+++ b/system/include/gc.h
@@ -1,6 +1,8 @@
/*
* Boehm-compatible GC API
*/
+#ifndef _GC_H_INCLUDED
+#define _GC_H_INCLUDED
#include <stdlib.h>
@@ -29,6 +31,12 @@ void *GC_MALLOC(int bytes);
/* Allocate memory for an object that the user promises will not contain pointers. */
void *GC_MALLOC_ATOMIC(int bytes);
+/* Allocate memory that might container pointers but that can't be collected. */
+void *GC_MALLOC_UNCOLLECTABLE(int bytes);
+
+/* Reallocate a GC managed memory block to a new size. */
+void *GC_REALLOC(void *ptr, int newBytes);
+
/* Explicitly deallocate an object. Dangerous as it forces a free and does not check if the object is reffed. */
void GC_FREE(void *ptr);
@@ -36,6 +44,9 @@ void GC_FREE(void *ptr);
void GC_REGISTER_FINALIZER_NO_ORDER(void *ptr, void (*func)(void *, void *), void *arg,
void *(*old_func)(void *, void *), void *old_arg);
+/* Gets the bytes allocated and managed by the GC */
+int GC_get_heap_size();
+
/* Non-Boehm additions */
/* Call this once per frame or such, it will collect if necessary */
@@ -56,3 +67,4 @@ void GC_enable_incremental();
}
#endif
+#endif