summaryrefslogtreecommitdiff
path: root/finalize.c
diff options
context:
space:
mode:
authorhboehm <hboehm>2007-12-21 01:40:38 +0000
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 21:06:41 +0400
commit67f39b1b09fcc52361e19d0472b3bb459d384c88 (patch)
tree470559f80ac1c51fe5431528f2ca1a75216f50da /finalize.c
parent76b3d3a57583fdb19152f4d911b11725e31b4a06 (diff)
downloadbdwgc-67f39b1b09fcc52361e19d0472b3bb459d384c88.tar.gz
2007-12-20 Hans Boehm <Hans.Boehm@hp.com>
* alloc.c: Deal correctly with address wrapping for GC_greatest_plausible_heap_addr and GC_least_plausible_heap_addr. * finalize.c, include/gc.h (GC_register_disappearing_link, GC_register_finalizer_inner): Improve out-of-memory handling. * include/private/gc_pmark.h: Fix comment spelling.
Diffstat (limited to 'finalize.c')
-rw-r--r--finalize.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/finalize.c b/finalize.c
index 6ae36c2d..259cd84f 100644
--- a/finalize.c
+++ b/finalize.c
@@ -188,7 +188,7 @@ int GC_general_register_disappearing_link(void * * link, void * obj)
GC_oom_fn(sizeof(struct disappearing_link));
if (0 == new_dl) {
GC_finalization_failures++;
- return(0);
+ return(2);
}
/* It's not likely we'll make it here, but ... */
# ifdef THREADS
@@ -392,7 +392,6 @@ GC_API void GC_register_finalizer_inner(void * obj,
}
new_fo = (struct finalizable_object *)
GC_INTERNAL_MALLOC(sizeof(struct finalizable_object),NORMAL);
- GC_ASSERT(GC_size(new_fo) >= sizeof(struct finalizable_object));
if (EXPECT(0 == new_fo, FALSE)) {
# ifdef THREADS
UNLOCK();
@@ -408,6 +407,7 @@ GC_API void GC_register_finalizer_inner(void * obj,
LOCK();
# endif
}
+ GC_ASSERT(GC_size(new_fo) >= sizeof(struct finalizable_object));
new_fo -> fo_hidden_base = (word)HIDE_POINTER(base);
new_fo -> fo_fn = fn;
new_fo -> fo_client_data = (ptr_t)cd;