diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2014-06-06 22:37:27 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2014-06-06 22:37:27 +0000 |
commit | 6736ef96eab222e58e6294f42be981a5afb59811 (patch) | |
tree | 2bc668fae9bf96f9a3988e0b0a16685bde8c4f0b /libgo/runtime/go-defer.c | |
parent | 38a138411da4206c53f9a153ee9c3624fce58a52 (diff) | |
download | gcc-6736ef96eab222e58e6294f42be981a5afb59811.zip gcc-6736ef96eab222e58e6294f42be981a5afb59811.tar.gz gcc-6736ef96eab222e58e6294f42be981a5afb59811.tar.bz2 |
libgo: Merge to master revision 19184.
The next revision, 19185, renames several runtime files, and
will be handled in a separate change.
From-SVN: r211328
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 4c61ae7..5dd8c31 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 |