diff options
-rw-r--r-- | libguile/deprecated.h | 6 | ||||
-rw-r--r-- | libguile/gc.c | 11 | ||||
-rw-r--r-- | libguile/gc.h | 9 | ||||
-rw-r--r-- | libguile/smob.c | 25 | ||||
-rw-r--r-- | libguile/struct.c | 4 | ||||
-rw-r--r-- | libguile/tags.h | 12 |
6 files changed, 9 insertions, 58 deletions
diff --git a/libguile/deprecated.h b/libguile/deprecated.h index 5b443c761..68eddb39e 100644 --- a/libguile/deprecated.h +++ b/libguile/deprecated.h @@ -5,7 +5,7 @@ #ifndef SCM_DEPRECATED_H #define SCM_DEPRECATED_H -/* Copyright (C) 2003,2004, 2005, 2006, 2007 Free Software Foundation, Inc. +/* Copyright (C) 2003,2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -117,8 +117,8 @@ SCM_API SCM scm_unprotect_object (SCM obj); (SCM_SETCDR ((x), SCM_PACK (SCM_UNPACK (SCM_CDR (x)) & (y)))) #define SCM_SETOR_CDR(x, y)\ (SCM_SETCDR ((x), SCM_PACK (SCM_UNPACK (SCM_CDR (x)) | (y)))) -#define SCM_FREEP(x) (SCM_FREE_CELL_P (x)) -#define SCM_NFREEP(x) (!SCM_FREE_CELL_P (x)) +#define SCM_FREEP(x) (0) +#define SCM_NFREEP(x) (1) #define SCM_GC8MARKP(x) SCM_GC_MARK_P (x) #define SCM_SETGC8MARK(x) SCM_SET_GC_MARK (x) #define SCM_CLRGC8MARK(x) SCM_CLEAR_GC_MARK (x) diff --git a/libguile/gc.c b/libguile/gc.c index cef9b3f6f..84d5ba8fa 100644 --- a/libguile/gc.c +++ b/libguile/gc.c @@ -763,15 +763,10 @@ scm_i_tag_name (scm_t_bits tag) { if (tag >= 255) { - if (tag == scm_tc_free_cell) - return "free cell"; - - { - int k = 0xff & (tag >> 8); - return (scm_smobs[k].name); - } + int k = 0xff & (tag >> 8); + return (scm_smobs[k].name); } - + switch (tag) /* 7 bits */ { case scm_tcs_struct: diff --git a/libguile/gc.h b/libguile/gc.h index e886bec4b..63b7c4eed 100644 --- a/libguile/gc.h +++ b/libguile/gc.h @@ -116,15 +116,6 @@ typedef struct scm_t_cell #define SCM_CELL_TYPE(x) SCM_CELL_WORD_0 (x) #define SCM_SET_CELL_TYPE(x, t) SCM_SET_CELL_WORD_0 ((x), (t)) -/* Freelists consist of linked cells where the type entry holds the value - * scm_tc_free_cell and the second entry holds a pointer to the next cell of - * the freelist. Due to this structure, freelist cells are not cons cells - * and thus may not be accessed using SCM_CAR and SCM_CDR. */ - -#define SCM_FREE_CELL_CDR(x) \ - (SCM_GC_CELL_OBJECT ((x), 1)) -#define SCM_SET_FREE_CELL_CDR(x, v) \ - (SCM_GC_SET_CELL_OBJECT ((x), 1, (v))) #if (SCM_DEBUG_CELL_ACCESSES == 1) /* Set this to != 0 if every cell that is accessed shall be checked: diff --git a/libguile/smob.c b/libguile/smob.c index b2c083cd3..86bb22f47 100644 --- a/libguile/smob.c +++ b/libguile/smob.c @@ -471,26 +471,6 @@ scm_make_smob (scm_t_bits tc) SCM_RETURN_NEWSMOB (tc, data); } - -/* {Initialization for the type of free cells} - */ - -static int -free_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED) -{ - char buf[100]; - sprintf (buf, "#<freed cell %p; GC missed a reference>", - (void *) SCM_UNPACK (exp)); - scm_puts (buf, port); - -#if (SCM_DEBUG_CELL_ACCESSES == 1) - if (scm_debug_cell_accesses_p) - abort(); -#endif - - - return 1; -} /* Marking SMOBs using user-supplied mark procedures. */ @@ -632,7 +612,6 @@ void scm_smob_prehistory () { long i; - scm_t_bits tc; smob_gc_kind = GC_new_kind (GC_new_free_list (), GC_MAKE_PROC (GC_new_proc (smob_mark), 0), @@ -657,10 +636,6 @@ scm_smob_prehistory () scm_smobs[i].apply_3 = 0; scm_smobs[i].gsubr_type = 0; } - - /* WARNING: This scm_make_smob_type call must be done first. */ - tc = scm_make_smob_type ("free", 0); - scm_set_smob_print (tc, free_print); } /* diff --git a/libguile/struct.c b/libguile/struct.c index 062b5245d..f701f8f83 100644 --- a/libguile/struct.c +++ b/libguile/struct.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1996,1997,1998,1999,2000,2001, 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. +/* Copyright (C) 1996,1997,1998,1999,2000,2001, 2003, 2004, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -338,7 +338,7 @@ struct_finalizer_trampoline (GC_PTR ptr, GC_PTR unused_data) scm_t_struct_free free_struct_data = ((scm_t_struct_free) vtable_data[scm_struct_i_free]); - SCM_SET_CELL_TYPE (obj, scm_tc_free_cell); + SCM_SET_CELL_TYPE (obj, scm_tc3_struct); #if 0 /* A sanity check. However, this check can fail if the free function diff --git a/libguile/tags.h b/libguile/tags.h index 329453341..43853dc60 100644 --- a/libguile/tags.h +++ b/libguile/tags.h @@ -3,7 +3,7 @@ #ifndef SCM_TAGS_H #define SCM_TAGS_H -/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2008 +/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2008,2009 * Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or @@ -374,10 +374,6 @@ typedef unsigned long scm_t_bits; * tc16 (for tc7==scm_tc7_smob): * The largest part of the space of smob types is not subdivided in a * predefined way, since smobs can be added arbitrarily by user C code. - * However, while Guile also defines a number of smob types throughout, - * there is one smob type, namely scm_tc_free_cell, for which Guile assumes - * that it is declared first and thus gets a known-in-advance tc16-code. - * The reason of requiring a fixed tc16-code for this type is performance. */ @@ -484,12 +480,6 @@ typedef unsigned long scm_t_bits; #define SCM_TYP16_PREDICATE(tag, x) (!SCM_IMP (x) && SCM_TYP16 (x) == (tag)) -/* Here is the first smob subtype. */ - -/* scm_tc_free_cell is the 0th smob type. We place this in free cells to tell - * the conservative marker not to trace it. */ -#define scm_tc_free_cell (scm_tc7_smob + 0 * 256L) - /* {Immediate Values} |