summaryrefslogtreecommitdiff
path: root/malloc.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2011-07-26 13:20:24 +0200
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 13:20:24 +0200
commitc521d2cf164f9d7e1fa8be9c0b21d223e265fa64 (patch)
tree82fbd7e60e6be39fbabd946717cf065a698cd038 /malloc.c
parent7d3768dbd2a1cd4d5c14f773f23aec43bc0651a5 (diff)
gc4.13 tarball importgc4_13
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 6b8c092..37da584 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];