Raymond Toy pushed to branch issue-243-weak-pointer-to-static-array at cmucl / cmucl

Commits:

1 changed file:

Changes:

  • src/lisp/gencgc.c
    ... ... @@ -5431,8 +5431,17 @@ void
    5431 5431
     scan_weak_pointers(void)
    
    5432 5432
     {
    
    5433 5433
         struct weak_pointer *wp;
    
    5434
    +
    
    5435
    +    /*
    
    5436
    +     * Array of weak pointers to unmarked static vectors that can be
    
    5437
    +     * freed.
    
    5438
    +     */
    
    5434 5439
         struct weak_pointer **clearable_list;
    
    5440
    +
    
    5441
    +    /* Total number of weak pointers */
    
    5435 5442
         int num_weak_pointers = 0;
    
    5443
    +
    
    5444
    +    /* Number of static vectors that we can free */
    
    5436 5445
         int num_static_vectors = 0;
    
    5437 5446
         int n;
    
    5438 5447
         
    
    ... ... @@ -5514,6 +5523,9 @@ scan_weak_pointers(void)
    5514 5523
         }
    
    5515 5524
     
    
    5516 5525
         /*
    
    5526
    +     * At this point, clearable_list contains all the weak pointers to
    
    5527
    +     * unmarked (unused) static vecotors.
    
    5528
    +     *
    
    5517 5529
          * Traverse the clearable list.  If the weak pointer points to an
    
    5518 5530
          * unmarked static vector, mark it.  If it points to a marked
    
    5519 5531
          * static vector, then we know it shares a referent with another
    
    ... ... @@ -5559,8 +5571,12 @@ scan_weak_pointers(void)
    5559 5571
         }
    
    5560 5572
     
    
    5561 5573
         /*
    
    5562
    -     * Traverse the clearable list and free the static vector,
    
    5563
    -     * skipping over any NIL values.
    
    5574
    +     * At this point, the clearable list is either NIL or a weak
    
    5575
    +     * pointer that references a unique dead static vector.
    
    5576
    +     *
    
    5577
    +     * Traverse the clearable list skipping over any NIL entries.  For
    
    5578
    +     * all other entries, free the static vector and break the weak
    
    5579
    +     * pointer.
    
    5564 5580
          */
    
    5565 5581
     
    
    5566 5582
         if (debug_static_array_p) {