diff options
Diffstat (limited to 'malloc.c')
-rw-r--r-- | malloc.c | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -19,16 +19,19 @@ #include <stdio.h> #include <string.h> -/* Allocate reclaim list for kind: */ -/* Return TRUE on success */ +/* Allocate reclaim list for the kind. Returns TRUE on success. */ STATIC GC_bool GC_alloc_reclaim_list(struct obj_kind *kind) { - struct hblk ** result = (struct hblk **) - GC_scratch_alloc((MAXOBJGRANULES+1) * sizeof(struct hblk *)); - if (result == 0) return(FALSE); + struct hblk ** result; + + GC_ASSERT(I_HOLD_LOCK()); + result = (struct hblk **)GC_scratch_alloc( + (MAXOBJGRANULES+1) * sizeof(struct hblk *)); + if (EXPECT(NULL == result, FALSE)) return FALSE; + BZERO(result, (MAXOBJGRANULES+1)*sizeof(struct hblk *)); kind -> ok_reclaim_list = result; - return(TRUE); + return TRUE; } /* Allocate a large block of size lb bytes. */ |