Changeset 15821


Ignore:
Timestamp:
May 24, 2013, 4:15:16 PM (8 years ago)
Author:
gb
Message:

Handle null refidx when checking refmap consistency.
Don't call memset() in zero_bits.
zero out refmaps/refidx's when tenuring to tenured area. (Should
use indices to find set bits in maps; shouldn't usually be many.)

Location:
trunk/source/lisp-kernel
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/arm-gc.c

    r15820 r15821  
    758758          Bug(NULL, "Missing memoization in doublenode at 0x" LISP "\n", start);
    759759          set_bit(refbits, ref_dnode);
    760           set_bit(refidx,ref_dnode>>8);
     760          if (refidx) {
     761            set_bit(refidx,ref_dnode>>8);
     762          }
    761763        } else {
    762           if (!ref_bit(refidx, ref_dnode>>8)) {
    763             Bug(NULL, "Memoization for doublenode at 0x" LISP " not indexed\n", start);
    764             set_bit(refidx,ref_dnode>>8);
     764          if (refidx) {
     765            if (!ref_bit(refidx, ref_dnode>>8)) {
     766              Bug(NULL, "Memoization for doublenode at 0x" LISP " not indexed\n", start);
     767              set_bit(refidx,ref_dnode>>8);
     768            }
    765769          }
    766770        }
  • trunk/source/lisp-kernel/bits.c

    r13067 r15821  
    5454}
    5555
    56 /* Note that this zeros longwords */
     56/* Note that this zeros natural-sized words */
    5757void
    5858zero_bits(bitvector bits, natural nbits)
    5959{
    60   memset(bits, 0, ((sizeof(natural)*(((nbits+(nbits_in_word-1)))>>bitmap_shift))));
     60  natural i, n = (((nbits+(nbits_in_word-1)))>>bitmap_shift);
     61 
     62  for(i=0; i < n; i++) {
     63    bits[i]= 0;
     64  }
    6165}
    6266
  • trunk/source/lisp-kernel/gc-common.c

    r15820 r15821  
    11011101  hash_table_vector_header *hashp = NULL;
    11021102  Boolean header_p;
     1103  bitvector refidx = NULL;
     1104 
     1105  if (refbits == a->refbits) {
     1106    refidx = a->refidx;
     1107  }
    11031108
    11041109
     
    11061111  if (num_memo_dnodes) {
    11071112    if (GCDebug) {
    1108       check_refmap_consistency(p, p+(num_memo_dnodes << 1), refbits, a->refidx);
     1113      check_refmap_consistency(p, p+(num_memo_dnodes << 1), refbits, refidx);
    11091114    }
    11101115
     
    13071312  if (num_memo_dnodes) {
    13081313    if (GCDebug) {
    1309       check_refmap_consistency(p, p+(num_memo_dnodes << 1), refbits, a->refidx);
     1314      check_refmap_consistency(p, p+(num_memo_dnodes << 1), refbits, NULL);
    13101315    }
    13111316
     
    13481353    if (GCDebug) {
    13491354      p = (LispObj *) a->low;
    1350       check_refmap_consistency(p, p+(num_memo_dnodes << 1), refbits, a->refidx);
     1355      check_refmap_consistency(p, p+(num_memo_dnodes << 1), refbits, NULL);
    13511356    }
    13521357  }
  • trunk/source/lisp-kernel/gc.h

    r15820 r15821  
    6464extern LispObj GCarealow, GCareadynamiclow;
    6565extern natural GCndnodes_in_area, GCndynamic_dnodes_in_area;
    66 extern bitvector GCmarkbits, GCdynamic_markbits,managed_static_refbits,global_refidx;
     66extern bitvector GCmarkbits, GCdynamic_markbits,managed_static_refbits,global_refidx,dynamic_refidx;
    6767LispObj *global_reloctab, *GCrelocptr;
    6868LispObj GCfirstunmarked;
  • trunk/source/lisp-kernel/memory.c

    r15815 r15821  
    655655  if (target == tenured_area) {
    656656    zero_bits(refbits, new_tenured_dnodes);
     657    zero_bits(managed_static_area->refbits, managed_static_area->ndnodes);
     658    zero_bits(global_refidx, (managed_static_area->ndnodes+255)>>8);
     659    zero_bits(dynamic_refidx,(new_tenured_dnodes+255)>>8);
    657660    lisp_global(OLDEST_EPHEMERAL) = ptr_to_lispobj(curfree);
    658661  } else {
  • trunk/source/lisp-kernel/ppc-gc.c

    r15820 r15821  
    875875        Bug(NULL, "Missing memoization in doublenode at 0x" LISP "\n", start);
    876876        set_bit(refbits, ref_dnode);
    877         set_bit(refidx,ref_dnode>>8);
     877        if (refidx) {
     878          set_bit(refidx,ref_dnode>>8);
     879        }
    878880      } else {
    879         if (!ref_bit(refidx, ref_dnode>>8)) {
    880           Bug(NULL, "Memoization for doublenode at 0x" LISP " not indexed\n", start);
    881           set_bit(refidx,ref_dnode>>8);
     881        if (refidx) {
     882          if (!ref_bit(refidx, ref_dnode>>8)) {
     883            Bug(NULL, "Memoization for doublenode at 0x" LISP " not indexed\n", start);
     884            set_bit(refidx,ref_dnode>>8);
     885          }
    882886        }
    883887      }
  • trunk/source/lisp-kernel/x86-gc.c

    r15820 r15821  
    12731273          Bug(NULL, "Missing memoization in doublenode at 0x" LISP "\n", start);
    12741274          set_bit(refbits, ref_dnode);
    1275           set_bit(refidx, ref_dnode>>8);
     1275          if (refidx) {
     1276            set_bit(refidx, ref_dnode>>8);
     1277          }
    12761278        } else {
    1277           if (!ref_bit(refidx, ref_dnode>>8)) {
    1278             Bug(NULL, "Memoization for doublenode at 0x" LISP " not indexed\n", start);
    1279             set_bit(refidx,ref_dnode>>8);
     1279          if (refidx) {
     1280            if (!ref_bit(refidx, ref_dnode>>8)) {
     1281              Bug(NULL, "Memoization for doublenode at 0x" LISP " not indexed\n", start);
     1282              set_bit(refidx,ref_dnode>>8);
     1283            }
    12801284          }
    12811285        }
Note: See TracChangeset for help on using the changeset viewer.