summaryrefslogtreecommitdiff
path: root/malloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'malloc.c')
-rw-r--r--malloc.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/malloc.c b/malloc.c
index 6b8c0921..37da584c 100644
--- a/malloc.c
+++ b/malloc.c
@@ -21,7 +21,7 @@ void GC_extend_size_map(); /* in misc.c. */
/* Allocate reclaim list for kind: */
/* Return TRUE on success */
-bool GC_alloc_reclaim_list(kind)
+GC_bool GC_alloc_reclaim_list(kind)
register struct obj_kind * kind;
{
struct hblk ** result = (struct hblk **)
@@ -115,7 +115,7 @@ register int k;
ptr_t result;
DCL_LOCK_STATE;
- GC_invoke_finalizers();
+ GC_INVOKE_FINALIZERS();
DISABLE_SIGNALS();
LOCK();
result = GC_generic_malloc_inner(lb, k);
@@ -220,6 +220,9 @@ DCL_LOCK_STATE;
/*
* Thread initialisation can call malloc before
* we're ready for it.
+ * It's not clear that this is enough to help matters.
+ * The thread implementation may well call malloc at other
+ * inopportune times.
*/
if (!GC_is_initialized) return sbrk(lb);
# endif /* I386 && SOLARIS_THREADS */
@@ -375,6 +378,12 @@ int obj_kind;
/* Required by ANSI. It's not my fault ... */
h = HBLKPTR(p);
hhdr = HDR(h);
+# if defined(REDIRECT_MALLOC) && \
+ (defined(SOLARIS_THREADS) || defined(LINUX_THREADS))
+ /* We have to redirect malloc calls during initialization. */
+ /* Don't try to deallocate that memory. */
+ if (0 == hhdr) return;
+# endif
knd = hhdr -> hb_obj_kind;
sz = hhdr -> hb_sz;
ok = &GC_obj_kinds[knd];