aboutsummaryrefslogtreecommitdiff
path: root/system/include
diff options
context:
space:
mode:
Diffstat (limited to 'system/include')
-rw-r--r--system/include/gc.h9
-rw-r--r--system/include/libc/sys/features.h5
-rw-r--r--system/include/libc/sys/types.h6
3 files changed, 13 insertions, 7 deletions
diff --git a/system/include/gc.h b/system/include/gc.h
index e0419dcb..8c5a8989 100644
--- a/system/include/gc.h
+++ b/system/include/gc.h
@@ -29,6 +29,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 +42,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 */
diff --git a/system/include/libc/sys/features.h b/system/include/libc/sys/features.h
index 87a520a0..8c32bf04 100644
--- a/system/include/libc/sys/features.h
+++ b/system/include/libc/sys/features.h
@@ -26,7 +26,10 @@ extern "C" {
#endif
#if EMSCRIPTEN
-#define _POSIX_REALTIME_SIGNALS 1
+#define _POSIX_REALTIME_SIGNALS 1
+#define _POSIX_THREADS 200112L
+#define _UNIX98_THREAD_MUTEX_ATTRIBUTES 1
+#define _POSIX_READER_WRITER_LOCKS 200112L
#endif
/* RTEMS adheres to POSIX -- 1003.1b with some features from annexes. */
diff --git a/system/include/libc/sys/types.h b/system/include/libc/sys/types.h
index e90a74ac..c36f724c 100644
--- a/system/include/libc/sys/types.h
+++ b/system/include/libc/sys/types.h
@@ -24,12 +24,6 @@
#include <machine/_types.h>
-#if EMSCRIPTEN
- #define _POSIX_THREADS
- #define _UNIX98_THREAD_MUTEX_ATTRIBUTES
- #define _POSIX_READER_WRITER_LOCKS
-#endif
-
#if defined(__rtems__) || defined(__XMK__) || defined(EMSCRIPTEN)
/*
* The following section is RTEMS specific and is needed to more