import gc6.1alpha5

This commit is contained in:
Fumitoshi UKAI
2002-07-10 14:21:11 +00:00
parent adfa59bd5f
commit bb118b7356
72 changed files with 18916 additions and 8113 deletions

View File

@@ -207,7 +207,8 @@ signed_word * log_size_ptr;
UNLOCK();
ENABLE_SIGNALS();
# endif
new_dl = GC_oom_fn(sizeof(struct disappearing_link));
new_dl = (struct disappearing_link *)
GC_oom_fn(sizeof(struct disappearing_link));
if (0 == new_dl) {
GC_finalization_failures++;
return(0);
@@ -433,7 +434,8 @@ finalization_mark_proc * mp;
UNLOCK();
ENABLE_SIGNALS();
# endif
new_fo = GC_oom_fn(sizeof(struct finalizable_object));
new_fo = (struct finalizable_object *)
GC_oom_fn(sizeof(struct finalizable_object));
if (0 == new_fo) {
GC_finalization_failures++;
return;
@@ -759,8 +761,10 @@ int GC_should_invoke_finalizers GC_PROTO((void))
/* Should be called without allocation lock. */
int GC_invoke_finalizers()
{
register struct finalizable_object * curr_fo;
register int count = 0;
struct finalizable_object * curr_fo;
int count = 0;
word mem_freed_before;
GC_bool first_time = TRUE;
DCL_LOCK_STATE;
while (GC_finalize_now != 0) {
@@ -768,6 +772,10 @@ int GC_invoke_finalizers()
DISABLE_SIGNALS();
LOCK();
# endif
if (first_time) {
mem_freed_before = GC_mem_freed;
first_time = FALSE;
}
curr_fo = GC_finalize_now;
# ifdef THREADS
if (curr_fo != 0) GC_finalize_now = fo_next(curr_fo);
@@ -789,6 +797,11 @@ int GC_invoke_finalizers()
GC_free((GC_PTR)curr_fo);
# endif
}
if (mem_freed_before != GC_mem_freed) {
LOCK();
GC_finalizer_mem_freed += (GC_mem_freed - mem_freed_before);
UNLOCK();
}
return count;
}