diff --git a/libguile/gc.c b/libguile/gc.c index 2ae1abb8e..d2e379b1a 100644 --- a/libguile/gc.c +++ b/libguile/gc.c @@ -291,9 +291,11 @@ scm_check_freelist () } static int scm_debug_check_freelist = 0; -void -scm_debug_newcell (SCM *into) +SCM +scm_debug_newcell (void) { + SCM new; + scm_newcell_count++; if (scm_debug_check_freelist) scm_check_freelist (); @@ -301,13 +303,15 @@ scm_debug_newcell (SCM *into) /* The rest of this is supposed to be identical to the SCM_NEWCELL macro. */ if (SCM_IMP (scm_freelist)) - *into = scm_gc_for_newcell (); + new = scm_gc_for_newcell (); else { - *into = scm_freelist; + new = scm_freelist; scm_freelist = SCM_CDR (scm_freelist); ++scm_cells_allocated; } + + return new; } #endif /* DEBUG_FREELIST */ diff --git a/libguile/gc.h b/libguile/gc.h index 9de5817ea..709227d39 100644 --- a/libguile/gc.h +++ b/libguile/gc.h @@ -69,7 +69,7 @@ extern unsigned long scm_mallocated; extern unsigned long scm_mtrigger; #ifdef DEBUG_FREELIST -extern void scm_debug_newcell (SCM *into); +extern SCM scm_debug_newcell (void); #endif diff --git a/libguile/pairs.h b/libguile/pairs.h index e3e6355ef..3b5661041 100644 --- a/libguile/pairs.h +++ b/libguile/pairs.h @@ -145,7 +145,7 @@ typedef SCM huge *SCMPTR; #ifdef DEBUG_FREELIST -#define SCM_NEWCELL(_into) (scm_debug_newcell (&_into)) +#define SCM_NEWCELL(_into) (_into = scm_debug_newcell ()) #else #define SCM_NEWCELL(_into) \ { \