(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.
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();
UNLOCK();
return((*oom_fn)(lb));
}
- *(void **)op = ptr_to_struct_containing_descr;
- UNLOCK();
}
+ *(void **)op = ptr_to_struct_containing_descr;
+ UNLOCK();
return((void *) op);
}
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,