diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-06-06 22:37:27 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-06-06 22:37:27 +0000 |
commit | a756a05a63c16e653903ee8078d9760185cab545 (patch) | |
tree | 2bc668fae9bf96f9a3988e0b0a16685bde8c4f0b /libgo/runtime/go-defer.c | |
parent | b9f71945eda675b307727a5d1b8455887ee30fee (diff) | |
download | gcc-a756a05a63c16e653903ee8078d9760185cab545.tar.gz |
libgo: Merge to master revision 19184.
The next revision, 19185, renames several runtime files, and
will be handled in a separate change.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@211328 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo/runtime/go-defer.c')
-rw-r--r-- | libgo/runtime/go-defer.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/libgo/runtime/go-defer.c b/libgo/runtime/go-defer.c index 4c61ae7db2f..5dd8c3105f7 100644 --- a/libgo/runtime/go-defer.c +++ b/libgo/runtime/go-defer.c @@ -20,7 +20,7 @@ __go_defer (_Bool *frame, void (*pfn) (void *), void *arg) struct __go_defer_stack *n; g = runtime_g (); - n = (struct __go_defer_stack *) __go_alloc (sizeof (struct __go_defer_stack)); + n = runtime_newdefer (); n->__next = g->defer; n->__frame = frame; n->__panic = g->panic; @@ -28,7 +28,7 @@ __go_defer (_Bool *frame, void (*pfn) (void *), void *arg) n->__arg = arg; n->__retaddr = NULL; n->__makefunc_can_recover = 0; - n->__free = 1; + n->__special = 0; g->defer = n; } @@ -44,7 +44,6 @@ __go_undefer (_Bool *frame) { struct __go_defer_stack *d; void (*pfn) (void *); - M *m; d = g->defer; pfn = d->__pfn; @@ -59,9 +58,8 @@ __go_undefer (_Bool *frame) call to syscall.CgocallBackDone, in which case we will not have a memory context. Don't try to free anything in that case--the GC will release it later. */ - m = runtime_m (); - if (m != NULL && m->mcache != NULL && d->__free) - __go_free (d); + if (runtime_m () != NULL) + runtime_freedefer (d); /* Since we are executing a defer function here, we know we are returning from the calling function. If the calling |