aboutsummaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-05-15 13:37:09 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-05-15 13:37:09 -0700
commit46f641bf1e97000a774a5747128c965ea9d425be (patch)
treee0593c70c0aa6ed71b4a90895ced5d9f41b5a160 /system
parent1a55bf326caa5e2a8f3a1d3a0494f3a44a10f47d (diff)
working early gc test
Diffstat (limited to 'system')
-rw-r--r--system/include/gc.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/system/include/gc.h b/system/include/gc.h
index 773098ff..baeaf2b5 100644
--- a/system/include/gc.h
+++ b/system/include/gc.h
@@ -2,16 +2,18 @@
* Boehm-compatible GC API
*/
+#include <stdlib.h>
+
#ifdef __cplusplus
extern "C" {
#endif
void __attribute__((used)) __GC_KEEPALIVE__() {
// Force inclusion of necessary dlmalloc functions
- static times = 1;
+ static int times = 1;
void *x = malloc(times);
free(x);
- x = calloc(times);
+ x = calloc(times, 1);
free(x);
times++;
}
@@ -29,8 +31,8 @@ void *GC_MALLOC_ATOMIC(int bytes);
void GC_FREE(void *ptr);
/* Register a finalizer. func(ptr, arg) will be called. The old values are saved in old_func, old_arg */
-void GC_REGISTER_FINALIZER_NO_ORDER((void*)ptr, void (*func)(), void *arg,
- void *(*old_func)(), void *old_arg);
+void GC_REGISTER_FINALIZER_NO_ORDER(void *ptr, void (*func)(void *, void *), void *arg,
+ void *(*old_func)(void *, void *), void *old_arg);
/* Non-Boehm additions */