diff options
Diffstat (limited to 'libgo/runtime/go-cgo.c')
-rw-r--r-- | libgo/runtime/go-cgo.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/libgo/runtime/go-cgo.c b/libgo/runtime/go-cgo.c index d0c89f29459..47ee014181a 100644 --- a/libgo/runtime/go-cgo.c +++ b/libgo/runtime/go-cgo.c @@ -9,16 +9,6 @@ #include "interface.h" #include "go-panic.h" -/* Go memory allocated by code not written in Go. We keep a linked - list of these allocations so that the garbage collector can see - them. */ - -struct cgoalloc -{ - struct cgoalloc *next; - void *alloc; -}; - /* Prepare to call from code written in Go to code written in C or C++. This takes the current goroutine out of the Go scheduler, as though it were making a system call. Otherwise the program can @@ -67,7 +57,7 @@ syscall_cgocalldone () /* We are going back to Go, and we are not in a recursive call. Let the garbage collector clean up any unreferenced memory. */ - g->cgoalloc = NULL; + g->cgomal = NULL; } /* If we are invoked because the C function called _cgo_panic, then @@ -100,15 +90,15 @@ alloc_saved (size_t n) { void *ret; G *g; - struct cgoalloc *c; + CgoMal *c; ret = __go_alloc (n); g = runtime_g (); - c = (struct cgoalloc *) __go_alloc (sizeof (struct cgoalloc)); - c->next = g->cgoalloc; + c = (CgoMal *) __go_alloc (sizeof (CgoMal)); + c->next = g->cgomal; c->alloc = ret; - g->cgoalloc = c; + g->cgomal = c; return ret; } |