From 4452c19323b9ad4669023720fda9b90ffed8de8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=BCbinette=20=28Hubbe=29?= <hubbe@hubbe.net> Date: Wed, 2 Feb 2000 14:57:09 -0800 Subject: [PATCH] bugfix for compiling without debug Rev: src/gc.c:1.47 --- src/gc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gc.c b/src/gc.c index a04d1984c3..874968a489 100644 --- a/src/gc.c +++ b/src/gc.c @@ -29,7 +29,7 @@ struct callback *gc_evaluator_callback=0; #include "block_alloc.h" -RCSID("$Id: gc.c,v 1.46 2000/02/02 00:38:27 hubbe Exp $"); +RCSID("$Id: gc.c,v 1.47 2000/02/02 22:57:09 hubbe Exp $"); /* Run garbage collect approximate every time we have * 20 percent of all arrays, objects and programs is @@ -47,6 +47,8 @@ INT32 num_allocs =0; INT32 alloc_threshold = MIN_ALLOC_THRESHOLD; static int in_gc = 0; struct pike_queue gc_mark_queue; +time_t last_gc; + static double objects_alloced = 0.0; static double objects_freed = 0.0; @@ -72,8 +74,6 @@ PTR_HASH_ALLOC(marker,MARKER_CHUNK_SIZE) #ifdef PIKE_DEBUG -time_t last_gc; - void dump_gc_info(void) { fprintf(stderr,"Current number of objects: %ld\n",(long)num_objects); @@ -612,10 +612,11 @@ void do_gc(void) if(num_objects < 0) fatal("Panic, less than zero objects!\n"); - last_gc=TIME(0); #endif + last_gc=TIME(0); + multiplier=pow(MULTIPLIER, (double) num_allocs / (double) alloc_threshold); objects_alloced*=multiplier; objects_alloced += (double) num_allocs; -- GitLab