diff options
-rw-r--r-- | gcj_mlc.c | 6 | ||||
-rw-r--r-- | typd_mlc.c | 16 |
2 files changed, 9 insertions, 13 deletions
@@ -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); } @@ -636,15 +636,13 @@ GC_API GC_ATTR_MALLOC void * GC_CALL GC_bytes_allocd += GRANULES_TO_BYTES((word)lg); UNLOCK(); } - ((word *)op)[GRANULES_TO_WORDS(lg) - 1] = d; - } else { - op = (ptr_t)GENERAL_MALLOC_IOP(lb, GC_explicit_kind); - if (op != NULL) { - lg = BYTES_TO_GRANULES(GC_size(op)); - ((word *)op)[GRANULES_TO_WORDS(lg) - 1] = d; - } - } - return op; + } else { + op = (ptr_t)GENERAL_MALLOC_IOP(lb, GC_explicit_kind); + if (NULL == op) return NULL; + lg = BYTES_TO_GRANULES(GC_size(op)); + } + ((word *)op)[GRANULES_TO_WORDS(lg) - 1] = d; + return op; } GC_API GC_ATTR_MALLOC void * GC_CALL GC_calloc_explicitly_typed(size_t n, |