summaryrefslogtreecommitdiff
path: root/libguile/smob.c
diff options
context:
space:
mode:
authorJim Blandy <jimb@red-bean.com>1998-12-05 16:52:34 +0000
committerJim Blandy <jimb@red-bean.com>1998-12-05 16:52:34 +0000
commitceef3208343fc1d65db106974220036eda1e99d5 (patch)
tree60910aed1c635832ff24c34308a40cd20ce9da67 /libguile/smob.c
parent6ab397f48ef0f05c3d203daf71d499f588c1b2e0 (diff)
downloadguile-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.c17
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
};