summaryrefslogtreecommitdiff
path: root/malloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'malloc.c')
-rw-r--r--malloc.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/malloc.c b/malloc.c
index 45e9d655..bfc5e109 100644
--- a/malloc.c
+++ b/malloc.c
@@ -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. */