1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-12 23:00:22 +02:00

* gc.c (SCM_HEAP_SEG_SIZE, CELL_UP, CELL_DN, DOUBLECELL_ALIGNED_P,

NEXT_DATA_CELL, init_heap_seg, alloc_some_heap), gc.h (struct
scm_cell, struct scm_t_cell, SCM_CELLPTR, SCM_GC_CARD_SIZE,
SCM_GC_IN_CARD_HEADERP), tags.h (SCM_CELLP):  Renamed the struct
scm_cell and all its uses to scm_t_cell in accordance to Guile's
naming scheme for types.  The type name scm_cell is deprecated.
This commit is contained in:
Dirk Herrmann 2002-03-01 21:12:47 +00:00
parent c2b699ef33
commit 905f50c99d
4 changed files with 33 additions and 20 deletions

View file

@ -1,3 +1,12 @@
2002-03-01 Dirk Herrmann <D.Herrmann@tu-bs.de>
* gc.c (SCM_HEAP_SEG_SIZE, CELL_UP, CELL_DN, DOUBLECELL_ALIGNED_P,
NEXT_DATA_CELL, init_heap_seg, alloc_some_heap), gc.h (struct
scm_cell, struct scm_t_cell, SCM_CELLPTR, SCM_GC_CARD_SIZE,
SCM_GC_IN_CARD_HEADERP), tags.h (SCM_CELLP): Renamed the struct
scm_cell and all its uses to scm_t_cell in accordance to Guile's
naming scheme for types. The type name scm_cell is deprecated.
2002-02-26 Thien-Thi Nguyen <ttn@giblet.glug.org> 2002-02-26 Thien-Thi Nguyen <ttn@giblet.glug.org>
* Makefile.am: Update path to pre-inst-guile automake frag. * Makefile.am: Update path to pre-inst-guile automake frag.

View file

@ -277,9 +277,9 @@ size_t scm_default_max_segment_size = 2097000L;/* a little less (adm) than 2 Mb
# define SCM_HEAP_SEG_SIZE 32768L # define SCM_HEAP_SEG_SIZE 32768L
#else #else
# ifdef sequent # ifdef sequent
# define SCM_HEAP_SEG_SIZE (7000L * sizeof (scm_cell)) # define SCM_HEAP_SEG_SIZE (7000L * sizeof (scm_t_cell))
# else # else
# define SCM_HEAP_SEG_SIZE (16384L * sizeof (scm_cell)) # define SCM_HEAP_SEG_SIZE (16384L * sizeof (scm_t_cell))
# endif # endif
#endif #endif
/* Make heap grow with factor 1.5 */ /* Make heap grow with factor 1.5 */
@ -287,7 +287,7 @@ size_t scm_default_max_segment_size = 2097000L;/* a little less (adm) than 2 Mb
#define SCM_INIT_MALLOC_LIMIT 100000 #define SCM_INIT_MALLOC_LIMIT 100000
#define SCM_MTRIGGER_HYSTERESIS (SCM_INIT_MALLOC_LIMIT/10) #define SCM_MTRIGGER_HYSTERESIS (SCM_INIT_MALLOC_LIMIT/10)
/* CELL_UP and CELL_DN are used by scm_init_heap_seg to find (scm_cell * span) /* CELL_UP and CELL_DN are used by scm_init_heap_seg to find (scm_t_cell * span)
aligned inner bounds for allocated storage */ aligned inner bounds for allocated storage */
#ifdef PROT386 #ifdef PROT386
@ -299,12 +299,12 @@ size_t scm_default_max_segment_size = 2097000L;/* a little less (adm) than 2 Mb
# define CELL_UP(p, span) (SCM_CELLPTR)(~(span) & ((long)(p)+(span))) # define CELL_UP(p, span) (SCM_CELLPTR)(~(span) & ((long)(p)+(span)))
# define CELL_DN(p, span) (SCM_CELLPTR)(~(span) & (long)(p)) # define CELL_DN(p, span) (SCM_CELLPTR)(~(span) & (long)(p))
# else # else
# define CELL_UP(p, span) (SCM_CELLPTR)(~(sizeof(scm_cell)*(span)-1L) & ((long)(p)+sizeof(scm_cell)*(span)-1L)) # define CELL_UP(p, span) (SCM_CELLPTR)(~(sizeof(scm_t_cell)*(span)-1L) & ((long)(p)+sizeof(scm_t_cell)*(span)-1L))
# define CELL_DN(p, span) (SCM_CELLPTR)(~(sizeof(scm_cell)*(span)-1L) & (long)(p)) # define CELL_DN(p, span) (SCM_CELLPTR)(~(sizeof(scm_t_cell)*(span)-1L) & (long)(p))
# endif /* UNICOS */ # endif /* UNICOS */
#endif /* PROT386 */ #endif /* PROT386 */
#define DOUBLECELL_ALIGNED_P(x) (((2 * sizeof (scm_cell) - 1) & SCM_UNPACK (x)) == 0) #define DOUBLECELL_ALIGNED_P(x) (((2 * sizeof (scm_t_cell) - 1) & SCM_UNPACK (x)) == 0)
#define ALIGNMENT_SLACK(freelist) (SCM_GC_CARD_SIZE - 1) #define ALIGNMENT_SLACK(freelist) (SCM_GC_CARD_SIZE - 1)
#define CLUSTER_SIZE_IN_BYTES(freelist) \ #define CLUSTER_SIZE_IN_BYTES(freelist) \
@ -1644,7 +1644,7 @@ gc_sweep_freelist_finish (scm_t_freelist *freelist)
#define NEXT_DATA_CELL(ptr, span) \ #define NEXT_DATA_CELL(ptr, span) \
do { \ do { \
scm_cell *nxt__ = CELL_UP ((char *) (ptr) + 1, (span)); \ scm_t_cell *nxt__ = CELL_UP ((char *) (ptr) + 1, (span)); \
(ptr) = (SCM_GC_IN_CARD_HEADERP (nxt__) ? \ (ptr) = (SCM_GC_IN_CARD_HEADERP (nxt__) ? \
CELL_UP (SCM_GC_CELL_CARD (nxt__) + SCM_GC_CARD_N_HEADER_CELLS, span) \ CELL_UP (SCM_GC_CELL_CARD (nxt__) + SCM_GC_CARD_N_HEADER_CELLS, span) \
: nxt__); \ : nxt__); \
@ -2272,9 +2272,9 @@ init_heap_seg (SCM_CELLPTR seg_org, size_t size, scm_t_freelist *freelist)
NEXT_DATA_CELL (ptr, span); NEXT_DATA_CELL (ptr, span);
while (ptr < seg_end) while (ptr < seg_end)
{ {
scm_cell *nxt = ptr; scm_t_cell *nxt = ptr;
scm_cell *prv = NULL; scm_t_cell *prv = NULL;
scm_cell *last_card = NULL; scm_t_cell *last_card = NULL;
int n_data_cells = (SCM_GC_CARD_N_DATA_CELLS / span) * SCM_CARDS_PER_CLUSTER - 1; int n_data_cells = (SCM_GC_CARD_N_DATA_CELLS / span) * SCM_CARDS_PER_CLUSTER - 1;
NEXT_DATA_CELL(nxt, span); NEXT_DATA_CELL(nxt, span);
@ -2287,7 +2287,7 @@ init_heap_seg (SCM_CELLPTR seg_org, size_t size, scm_t_freelist *freelist)
while (n_data_cells--) while (n_data_cells--)
{ {
scm_cell *card = SCM_GC_CELL_CARD (ptr); scm_t_cell *card = SCM_GC_CELL_CARD (ptr);
SCM scmptr = PTR2SCM (ptr); SCM scmptr = PTR2SCM (ptr);
nxt = ptr; nxt = ptr;
NEXT_DATA_CELL (nxt, span); NEXT_DATA_CELL (nxt, span);
@ -2310,7 +2310,7 @@ init_heap_seg (SCM_CELLPTR seg_org, size_t size, scm_t_freelist *freelist)
/* sanity check */ /* sanity check */
{ {
scm_cell *ref = seg_end; scm_t_cell *ref = seg_end;
NEXT_DATA_CELL (ref, span); NEXT_DATA_CELL (ref, span);
if (ref != ptr) if (ref != ptr)
/* [cmm] looks like the segment size doesn't divide cleanly by /* [cmm] looks like the segment size doesn't divide cleanly by
@ -2415,7 +2415,7 @@ alloc_some_heap (scm_t_freelist *freelist, policy_on_error error_policy)
#endif #endif
if (len < min_cells) if (len < min_cells)
len = min_cells + freelist->cluster_size; len = min_cells + freelist->cluster_size;
len *= sizeof (scm_cell); len *= sizeof (scm_t_cell);
/* force new sampling */ /* force new sampling */
freelist->collected = LONG_MAX; freelist->collected = LONG_MAX;
} }

View file

@ -51,24 +51,28 @@
typedef struct scm_cell typedef struct scm_t_cell
{ {
scm_t_bits word_0; scm_t_bits word_0;
scm_t_bits word_1; scm_t_bits word_1;
} scm_cell; } scm_t_cell;
#if (SCM_DEBUG_DEPRECATED == 0)
# define scm_cell scm_t_cell
#endif
/* SCM_CELLPTR is a pointer to a cons cell which may be compared or /* SCM_CELLPTR is a pointer to a cons cell which may be compared or
* differenced. * differenced.
*/ */
typedef scm_cell * SCM_CELLPTR; typedef scm_t_cell * SCM_CELLPTR;
/* Cray machines have pointers that are incremented once for each word, /* Cray machines have pointers that are incremented once for each word,
* rather than each byte, the 3 most significant bits encode the byte * rather than each byte, the 3 most significant bits encode the byte
* within the word. The following macros deal with this by storing the * within the word. The following macros deal with this by storing the
* native Cray pointers like the ones that looks like scm expects. This * native Cray pointers like the ones that looks like scm expects. This
* is done for any pointers that might appear in the car of a scm_cell, * is done for any pointers that might appear in the car of a scm_t_cell,
* pointers to scm_vector elts, functions, &c are not munged. * pointers to scm_vector elts, functions, &c are not munged.
*/ */
#ifdef _UNICOS #ifdef _UNICOS
@ -82,14 +86,14 @@ typedef scm_cell * SCM_CELLPTR;
#define SCM_GC_CARD_N_HEADER_CELLS 1 #define SCM_GC_CARD_N_HEADER_CELLS 1
#define SCM_GC_CARD_N_CELLS 256 #define SCM_GC_CARD_N_CELLS 256
#define SCM_GC_CARD_SIZE (SCM_GC_CARD_N_CELLS * sizeof (scm_cell)) #define SCM_GC_CARD_SIZE (SCM_GC_CARD_N_CELLS * sizeof (scm_t_cell))
#define SCM_GC_CARD_N_DATA_CELLS (SCM_GC_CARD_N_CELLS - SCM_GC_CARD_N_HEADER_CELLS) #define SCM_GC_CARD_N_DATA_CELLS (SCM_GC_CARD_N_CELLS - SCM_GC_CARD_N_HEADER_CELLS)
#define SCM_GC_CARD_BVEC_SIZE_IN_LIMBS \ #define SCM_GC_CARD_BVEC_SIZE_IN_LIMBS \
((SCM_GC_CARD_N_CELLS + SCM_C_BVEC_LIMB_BITS - 1) / SCM_C_BVEC_LIMB_BITS) ((SCM_GC_CARD_N_CELLS + SCM_C_BVEC_LIMB_BITS - 1) / SCM_C_BVEC_LIMB_BITS)
#define SCM_GC_IN_CARD_HEADERP(x) \ #define SCM_GC_IN_CARD_HEADERP(x) \
SCM_PTR_LT ((scm_cell *) (x), SCM_GC_CELL_CARD (x) + SCM_GC_CARD_N_HEADER_CELLS) SCM_PTR_LT ((scm_t_cell *) (x), SCM_GC_CELL_CARD (x) + SCM_GC_CARD_N_HEADER_CELLS)
#define SCM_GC_CARD_BVEC(card) ((scm_t_c_bvec_limb *) ((card)->word_0)) #define SCM_GC_CARD_BVEC(card) ((scm_t_c_bvec_limb *) ((card)->word_0))
#define SCM_GC_SET_CARD_BVEC(card, bvec) \ #define SCM_GC_SET_CARD_BVEC(card, bvec) \

View file

@ -297,7 +297,7 @@ typedef signed long scm_t_signed_bits;
#define SCM_CELLP(x) (((sizeof (scm_cell) - 1) & SCM_UNPACK (x)) == 0) #define SCM_CELLP(x) (((sizeof (scm_t_cell) - 1) & SCM_UNPACK (x)) == 0)
#define SCM_NCELLP(x) (!SCM_CELLP (x)) #define SCM_NCELLP(x) (!SCM_CELLP (x))
/* See numbers.h for macros relating to immediate integers. /* See numbers.h for macros relating to immediate integers.