diff options
author | Jim Blandy <jimb@red-bean.com> | 1998-12-05 16:52:34 +0000 |
---|---|---|
committer | Jim Blandy <jimb@red-bean.com> | 1998-12-05 16:52:34 +0000 |
commit | ceef3208343fc1d65db106974220036eda1e99d5 (patch) | |
tree | 60910aed1c635832ff24c34308a40cd20ce9da67 /libguile/smob.c | |
parent | 6ab397f48ef0f05c3d203daf71d499f588c1b2e0 (diff) | |
download | guile-ceef3208343fc1d65db106974220036eda1e99d5.tar.gz |
* smob.c (freeprint): New function.
(freecell): Use it to print freed objects, for slightly easier
debugging.
Diffstat (limited to 'libguile/smob.c')
-rw-r--r-- | libguile/smob.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/libguile/smob.c b/libguile/smob.c index 76d936a20..4bf826fc2 100644 --- a/libguile/smob.c +++ b/libguile/smob.c @@ -84,14 +84,29 @@ scm_newsmob (smob) return scm_tc7_smob + (scm_numsmob - 1) * 256; } + /* {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 = { 0, scm_free0, - 0, + freeprint, 0 }; |