This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Gc fix fix
- To: guile-sources at gnu dot org
- Subject: Gc fix fix
- From: Greg Harvey <Greg dot Harvey at thezone dot net>
- Date: 23 Dec 1999 22:26:51 -0330
- Cc: guile mailing list <guile at sourceware dot cygnus dot com>
A correction to the gc (forgot to add the code for the debug case in
the first patch) and a little explanation with SCM_NEWCELL:
Index: gc.c
===================================================================
RCS file: /cvs/guile/guile/guile-core/libguile/gc.c,v
retrieving revision 1.69
diff -c -c -r1.69 gc.c
*** gc.c 1999/12/16 20:48:04 1.69
--- gc.c 1999/12/24 01:56:12
***************
*** 329,334 ****
--- 329,335 ----
new = scm_freelist;
scm_freelist = SCM_CDR (scm_freelist);
++scm_cells_allocated;
+ SCM_SETCAR(new, scm_tc16_allocated);
}
return new;
Index: pairs.h
===================================================================
RCS file: /cvs/guile/guile/guile-core/libguile/pairs.h,v
retrieving revision 1.12
diff -c -c -r1.12 pairs.h
*** pairs.h 1999/12/12 02:36:16 1.12
--- pairs.h 1999/12/24 01:56:12
***************
*** 147,152 ****
--- 147,158 ----
#define SCM_CADDDR(OBJ) SCM_CAR (SCM_CDR (SCM_CDR (SCM_CDR (OBJ))))
#define SCM_CDDDDR(OBJ) SCM_CDR (SCM_CDR (SCM_CDR (SCM_CDR (OBJ))))
+ /* the allocated thing: The car of newcells are set to
+ scm_tc16_allocated to avoid the fragile state of newcells wrt the
+ gc. If it stays as a freecell, any allocation afterwards could
+ cause the cell to go back on the freelist, which will bite you
+ sometime afterwards */
+
#ifdef GUILE_DEBUG_FREELIST
#define SCM_NEWCELL(_into) do { _into = scm_debug_newcell (); } while (0)
--
Gregh