summaryrefslogtreecommitdiff
path: root/gcj_mlc.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2018-05-16 11:49:33 +0300
committerIvan Maidanski <ivmai@mail.ru>2018-05-16 11:49:33 +0300
commit888b7da8d2c504ab0f5d0163a58c6e29f5f86f22 (patch)
treefcbe14b37317db284d7d2b352013777e3e82b913 /gcj_mlc.c
parente7ba62e0de0d0c42c3732c7b7e82a92e679648a9 (diff)
downloadbdwgc-888b7da8d2c504ab0f5d0163a58c6e29f5f86f22.tar.gz
Remove code duplication in gcj_malloc and malloc_explicitly_typed
(code refactoring) * gcj_mlc.c [GC_GCJ_SUPPORT] (GC_gcj_malloc): Store ptr_to_struct_containing_descr in a single place of code. * typd_mlc.c (GC_malloc_explicitly_typed_ignore_off_page): Store d (to the object) in a single place of code.
Diffstat (limited to 'gcj_mlc.c')
-rw-r--r--gcj_mlc.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/gcj_mlc.c b/gcj_mlc.c
index 35b3d3f1..552520c6 100644
--- a/gcj_mlc.c
+++ b/gcj_mlc.c
@@ -180,9 +180,7 @@ static void maybe_finalize(void)
GC_gcjobjfreelist[lg] = (ptr_t)obj_link(op);
GC_bytes_allocd += GRANULES_TO_BYTES((word)lg);
}
- *(void **)op = ptr_to_struct_containing_descr;
GC_ASSERT(((void **)op)[1] == 0);
- UNLOCK();
} else {
LOCK();
maybe_finalize();
@@ -192,9 +190,9 @@ static void maybe_finalize(void)
UNLOCK();
return((*oom_fn)(lb));
}
- *(void **)op = ptr_to_struct_containing_descr;
- UNLOCK();
}
+ *(void **)op = ptr_to_struct_containing_descr;
+ UNLOCK();
return((void *) op);
}