mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-11 14:21:10 +02:00
* pairs.h (SCM_NEWCELL): When DEBUG_FREELIST is defined, don't
take the address of _into; it might be a register. Just have scm_debug_newcell return the new cell. * gc.c (scm_debug_newcell): Just return the new cell, instead of taking the address of a place to store it as an argument. * gc.h (scm_debug_newcell): Change declaration. (Thanks to Greg Harvey.)
This commit is contained in:
parent
105ac23a5b
commit
f233316662
3 changed files with 10 additions and 6 deletions
|
@ -291,9 +291,11 @@ scm_check_freelist ()
|
||||||
}
|
}
|
||||||
|
|
||||||
static int scm_debug_check_freelist = 0;
|
static int scm_debug_check_freelist = 0;
|
||||||
void
|
SCM
|
||||||
scm_debug_newcell (SCM *into)
|
scm_debug_newcell (void)
|
||||||
{
|
{
|
||||||
|
SCM new;
|
||||||
|
|
||||||
scm_newcell_count++;
|
scm_newcell_count++;
|
||||||
if (scm_debug_check_freelist)
|
if (scm_debug_check_freelist)
|
||||||
scm_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
|
/* The rest of this is supposed to be identical to the SCM_NEWCELL
|
||||||
macro. */
|
macro. */
|
||||||
if (SCM_IMP (scm_freelist))
|
if (SCM_IMP (scm_freelist))
|
||||||
*into = scm_gc_for_newcell ();
|
new = scm_gc_for_newcell ();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
*into = scm_freelist;
|
new = scm_freelist;
|
||||||
scm_freelist = SCM_CDR (scm_freelist);
|
scm_freelist = SCM_CDR (scm_freelist);
|
||||||
++scm_cells_allocated;
|
++scm_cells_allocated;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return new;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* DEBUG_FREELIST */
|
#endif /* DEBUG_FREELIST */
|
||||||
|
|
|
@ -69,7 +69,7 @@ extern unsigned long scm_mallocated;
|
||||||
extern unsigned long scm_mtrigger;
|
extern unsigned long scm_mtrigger;
|
||||||
|
|
||||||
#ifdef DEBUG_FREELIST
|
#ifdef DEBUG_FREELIST
|
||||||
extern void scm_debug_newcell (SCM *into);
|
extern SCM scm_debug_newcell (void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -145,7 +145,7 @@ typedef SCM huge *SCMPTR;
|
||||||
|
|
||||||
|
|
||||||
#ifdef DEBUG_FREELIST
|
#ifdef DEBUG_FREELIST
|
||||||
#define SCM_NEWCELL(_into) (scm_debug_newcell (&_into))
|
#define SCM_NEWCELL(_into) (_into = scm_debug_newcell ())
|
||||||
#else
|
#else
|
||||||
#define SCM_NEWCELL(_into) \
|
#define SCM_NEWCELL(_into) \
|
||||||
{ \
|
{ \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue