diff options
Diffstat (limited to 'src/libcgo/util.c')
-rw-r--r-- | src/libcgo/util.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/libcgo/util.c b/src/libcgo/util.c index a814e018b..c296b493d 100644 --- a/src/libcgo/util.c +++ b/src/libcgo/util.c @@ -4,7 +4,7 @@ #include "libcgo.h" -/* Stub for calling malloc from the other world */ +/* Stub for calling malloc from Go */ void _cgo_malloc(void *p) { @@ -16,6 +16,17 @@ _cgo_malloc(void *p) a->ret = malloc(a->n); } +/* Stub for calling from Go */ +void +_cgo_free(void *p) +{ + struct a { + void *arg; + } *a = p; + + free(a->arg); +} + /* Stub for creating a new thread */ void libcgo_thread_start(ThreadStart *arg) |