mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-31 01:10:24 +02:00
* smob.c (freeprint): New function.
(freecell): Use it to print freed objects, for slightly easier debugging.
This commit is contained in:
parent
6ab397f48e
commit
ceef320834
1 changed files with 16 additions and 1 deletions
|
@ -84,14 +84,29 @@ scm_newsmob (smob)
|
||||||
return scm_tc7_smob + (scm_numsmob - 1) * 256;
|
return scm_tc7_smob + (scm_numsmob - 1) * 256;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* {Initialization for i/o types, float, bignum, the type of free cells}
|
/* {Initialization for i/o types, float, bignum, the type of free cells}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
static int
|
||||||
|
freeprint (SCM exp,
|
||||||
|
SCM port,
|
||||||
|
scm_print_state *pstate)
|
||||||
|
{
|
||||||
|
char buf[100];
|
||||||
|
|
||||||
|
sprintf (buf, "#<freed cell %p; GC missed a reference>", (void *) exp);
|
||||||
|
scm_puts (buf, port);
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static scm_smobfuns freecell =
|
static scm_smobfuns freecell =
|
||||||
{
|
{
|
||||||
0,
|
0,
|
||||||
scm_free0,
|
scm_free0,
|
||||||
0,
|
freeprint,
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue