/[guile]/guile/guile-core/libguile/gc-card.c
ViewVC logotype

Diff of /guile/guile-core/libguile/gc-card.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by hanwen, Thu Aug 8 23:18:23 2002 UTC revision 1.5 by hanwen, Wed Aug 28 23:13:30 2002 UTC
# Line 80  long int scm_i_deprecated_memory_return; Line 80  long int scm_i_deprecated_memory_return;
80   */   */
81    
82  int  int
83  scm_i_sweep_card (scm_t_cell *  p, SCM *free_list, int span)  scm_i_sweep_card (scm_t_cell *  p, SCM *free_list, scm_t_heap_segment*seg)
84  #define FUNC_NAME "sweep_card"  #define FUNC_NAME "sweep_card"
85  {  {
86    scm_t_c_bvec_long *bitvec = SCM_GC_CARD_BVEC(p);    scm_t_c_bvec_long *bitvec = SCM_GC_CARD_BVEC(p);
87    scm_t_cell * end = p + SCM_GC_CARD_N_CELLS;    scm_t_cell * end = p + SCM_GC_CARD_N_CELLS;
88      int span = seg->span;
89    int offset =SCM_MAX (SCM_GC_CARD_N_HEADER_CELLS, span);    int offset =SCM_MAX (SCM_GC_CARD_N_HEADER_CELLS, span);
90    int free_count  = 0;    int free_count  = 0;
91    
# Line 294  scm_i_sweep_card (scm_t_cell *  p, SCM * Line 295  scm_i_sweep_card (scm_t_cell *  p, SCM *
295    Like sweep, but no complicated logic to do the sweeping.    Like sweep, but no complicated logic to do the sweeping.
296   */   */
297  int  int
298  scm_init_card_freelist (scm_t_cell *  card, SCM *free_list, int span)  scm_i_init_card_freelist (scm_t_cell *  card, SCM *free_list,
299                            scm_t_heap_segment*seg)
300  {  {
301      int span = seg->span;
302    scm_t_cell *end = card + SCM_GC_CARD_N_CELLS;    scm_t_cell *end = card + SCM_GC_CARD_N_CELLS;
303    scm_t_cell *p = end - span;    scm_t_cell *p = end - span;
304    
305      scm_t_c_bvec_long * bvec_ptr =  (scm_t_c_bvec_long* ) seg->bounds[1];
306      int idx = (card  - seg->bounds[0]) / SCM_GC_CARD_N_CELLS;
307    
308      bvec_ptr += idx *SCM_GC_CARD_BVEC_SIZE_IN_LONGS;
309      SCM_GC_CELL_BVEC (card) = bvec_ptr;
310      
311    /*    /*
312       ASSUMPTION: n_header_cells <= 2.       ASSUMPTION: n_header_cells <= 2.
313     */     */
# Line 318  scm_init_card_freelist (scm_t_cell *  ca Line 327  scm_init_card_freelist (scm_t_cell *  ca
327  /*  /*
328    These functions are meant to be called from GDB as a debug aid.    These functions are meant to be called from GDB as a debug aid.
329    
330    I've left them as a convenience for future generations.    I've left them as a convenience for future generations. --hwn.
331   */   */
332    
333    

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26