diff options
author | hboehm <hboehm> | 2007-12-21 01:40:38 +0000 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2011-07-26 21:06:41 +0400 |
commit | 67f39b1b09fcc52361e19d0472b3bb459d384c88 (patch) | |
tree | 470559f80ac1c51fe5431528f2ca1a75216f50da /finalize.c | |
parent | 76b3d3a57583fdb19152f4d911b11725e31b4a06 (diff) | |
download | bdwgc-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.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; |