1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

add DEBUGINFO for mtrigger GCs.

This commit is contained in:
Han-Wen Nienhuys 2002-09-05 20:43:43 +00:00
parent cfcdb8e9a7
commit 61ef9c1fa3
2 changed files with 11 additions and 7 deletions

View file

@ -1,3 +1,7 @@
2002-09-05 Han-Wen Nienhuys <hanwen@cs.uu.nl>
* gc-malloc.c: add DEBUGINFO for mtrigger GCs.
2002-09-01 Marius Vollmer <mvo@zagadka.ping.de> 2002-09-01 Marius Vollmer <mvo@zagadka.ping.de>
* vectors.h (SCM_VECTOR_REF): New. * vectors.h (SCM_VECTOR_REF): New.

View file

@ -95,6 +95,7 @@ extern unsigned long * __libc_ia64_register_backing_store_base;
#define SCM_DEFAULT_INIT_MALLOC_LIMIT 200*1024 #define SCM_DEFAULT_INIT_MALLOC_LIMIT 200*1024
#define SCM_DEFAULT_MALLOC_MINYIELD 40 #define SCM_DEFAULT_MALLOC_MINYIELD 40
/* #define DEBUGINFO */
static int scm_i_minyield_malloc; static int scm_i_minyield_malloc;
@ -207,11 +208,12 @@ scm_gc_register_collectable_memory (void *mem, size_t size, const char *what)
yield = (prev_alloced - scm_mallocated) / (float) prev_alloced; yield = (prev_alloced - scm_mallocated) / (float) prev_alloced;
scm_gc_malloc_yield_percentage = (int) (100 * yield); scm_gc_malloc_yield_percentage = (int) (100 * yield);
/*
#ifdef DEBUGINFO
fprintf (stderr, "prev %lud , now %lud, yield %4.2lf, want %d", fprintf (stderr, "prev %lud , now %lud, yield %4.2lf, want %d",
prev_alloced, scm_mallocated, 100.0*yield, scm_i_minyield_malloc); prev_alloced, scm_mallocated, 100.0*yield, scm_i_minyield_malloc);
*/ #endif
if (yield < scm_i_minyield_malloc / 100.0) if (yield < scm_i_minyield_malloc / 100.0)
{ {
/* /*
@ -224,12 +226,10 @@ scm_gc_register_collectable_memory (void *mem, size_t size, const char *what)
*/ */
scm_mtrigger = (scm_mallocated * 110) / (100 - scm_i_minyield_malloc); scm_mtrigger = (scm_mallocated * 110) / (100 - scm_i_minyield_malloc);
/* #ifdef DEBUGINFO
fprintf (stderr, "Mtrigger sweep: ineffective. New trigger %d\n", scm_mtrigger); fprintf (stderr, "Mtrigger sweep: ineffective. New trigger %d\n", scm_mtrigger);
*/ #endif
} }
} }
#ifdef GUILE_DEBUG_MALLOC #ifdef GUILE_DEBUG_MALLOC