mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-11 22:31:12 +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:
parent
c2b699ef33
commit
905f50c99d
4 changed files with 33 additions and 20 deletions
|
@ -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>
|
||||
|
||||
* Makefile.am: Update path to pre-inst-guile automake frag.
|
||||
|
|
|
@ -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
|
||||
#else
|
||||
# ifdef sequent
|
||||
# define SCM_HEAP_SEG_SIZE (7000L * sizeof (scm_cell))
|
||||
# define SCM_HEAP_SEG_SIZE (7000L * sizeof (scm_t_cell))
|
||||
# else
|
||||
# define SCM_HEAP_SEG_SIZE (16384L * sizeof (scm_cell))
|
||||
# define SCM_HEAP_SEG_SIZE (16384L * sizeof (scm_t_cell))
|
||||
# endif
|
||||
#endif
|
||||
/* 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_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 */
|
||||
|
||||
#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_DN(p, span) (SCM_CELLPTR)(~(span) & (long)(p))
|
||||
# else
|
||||
# define CELL_UP(p, span) (SCM_CELLPTR)(~(sizeof(scm_cell)*(span)-1L) & ((long)(p)+sizeof(scm_cell)*(span)-1L))
|
||||
# define CELL_DN(p, span) (SCM_CELLPTR)(~(sizeof(scm_cell)*(span)-1L) & (long)(p))
|
||||
# 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_t_cell)*(span)-1L) & (long)(p))
|
||||
# endif /* UNICOS */
|
||||
#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 CLUSTER_SIZE_IN_BYTES(freelist) \
|
||||
|
@ -1644,7 +1644,7 @@ gc_sweep_freelist_finish (scm_t_freelist *freelist)
|
|||
|
||||
#define NEXT_DATA_CELL(ptr, span) \
|
||||
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__) ? \
|
||||
CELL_UP (SCM_GC_CELL_CARD (nxt__) + SCM_GC_CARD_N_HEADER_CELLS, span) \
|
||||
: nxt__); \
|
||||
|
@ -2272,9 +2272,9 @@ init_heap_seg (SCM_CELLPTR seg_org, size_t size, scm_t_freelist *freelist)
|
|||
NEXT_DATA_CELL (ptr, span);
|
||||
while (ptr < seg_end)
|
||||
{
|
||||
scm_cell *nxt = ptr;
|
||||
scm_cell *prv = NULL;
|
||||
scm_cell *last_card = NULL;
|
||||
scm_t_cell *nxt = ptr;
|
||||
scm_t_cell *prv = NULL;
|
||||
scm_t_cell *last_card = NULL;
|
||||
int n_data_cells = (SCM_GC_CARD_N_DATA_CELLS / span) * SCM_CARDS_PER_CLUSTER - 1;
|
||||
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--)
|
||||
{
|
||||
scm_cell *card = SCM_GC_CELL_CARD (ptr);
|
||||
scm_t_cell *card = SCM_GC_CELL_CARD (ptr);
|
||||
SCM scmptr = PTR2SCM (ptr);
|
||||
nxt = ptr;
|
||||
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 */
|
||||
{
|
||||
scm_cell *ref = seg_end;
|
||||
scm_t_cell *ref = seg_end;
|
||||
NEXT_DATA_CELL (ref, span);
|
||||
if (ref != ptr)
|
||||
/* [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
|
||||
if (len < min_cells)
|
||||
len = min_cells + freelist->cluster_size;
|
||||
len *= sizeof (scm_cell);
|
||||
len *= sizeof (scm_t_cell);
|
||||
/* force new sampling */
|
||||
freelist->collected = LONG_MAX;
|
||||
}
|
||||
|
|
|
@ -51,24 +51,28 @@
|
|||
|
||||
|
||||
|
||||
typedef struct scm_cell
|
||||
typedef struct scm_t_cell
|
||||
{
|
||||
scm_t_bits word_0;
|
||||
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
|
||||
* differenced.
|
||||
*/
|
||||
typedef scm_cell * SCM_CELLPTR;
|
||||
typedef scm_t_cell * SCM_CELLPTR;
|
||||
|
||||
|
||||
/* Cray machines have pointers that are incremented once for each word,
|
||||
* rather than each byte, the 3 most significant bits encode the byte
|
||||
* within the word. The following macros deal with this by storing the
|
||||
* 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.
|
||||
*/
|
||||
#ifdef _UNICOS
|
||||
|
@ -82,14 +86,14 @@ typedef scm_cell * SCM_CELLPTR;
|
|||
#define SCM_GC_CARD_N_HEADER_CELLS 1
|
||||
#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_BVEC_SIZE_IN_LIMBS \
|
||||
((SCM_GC_CARD_N_CELLS + SCM_C_BVEC_LIMB_BITS - 1) / SCM_C_BVEC_LIMB_BITS)
|
||||
|
||||
#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_SET_CARD_BVEC(card, bvec) \
|
||||
|
|
|
@ -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))
|
||||
|
||||
/* See numbers.h for macros relating to immediate integers.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue