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

Commits:

1 changed file:

Changes:

  • src/lisp/gencgc.c
    ... ... @@ -5423,48 +5423,6 @@ scan_static_vectors(struct weak_pointer *static_vector_list)
    5423 5423
     {
    
    5424 5424
         struct weak_pointer *wp;
    
    5425 5425
     
    
    5426
    -#if 0
    
    5427
    -    if (debug_static_array_p) {
    
    5428
    -        printf("Phase 1: Find static vectors\n");
    
    5429
    -    }
    
    5430
    -
    
    5431
    -    /*
    
    5432
    -     * Find weak pointers to static arrays, using a linked list.  We
    
    5433
    -     * reuse the next slot of the weak pointer to chain these weak
    
    5434
    -     * pointers together.
    
    5435
    -     *
    
    5436
    -     * Invariant: static_vector_list only has weak pointers to static
    
    5437
    -     * vectors.
    
    5438
    -     */
    
    5439
    -    wp = weak_pointers;
    
    5440
    -    while (wp) {
    
    5441
    -	lispobj value = wp->value;
    
    5442
    -        struct weak_pointer *next = wp->next;
    
    5443
    -
    
    5444
    -	if (Pointerp(value)) {
    
    5445
    -            /* The value may be a static vector */
    
    5446
    -            lispobj header = *(lispobj *) PTR(value);
    
    5447
    -
    
    5448
    -            if (maybe_static_array_p(header)) {
    
    5449
    -
    
    5450
    -                if (debug_static_array_p) {
    
    5451
    -                    printf("  Add:  wp %p value %p header 0x%08lx, next = %p\n",
    
    5452
    -                           wp, (lispobj *) wp->value, header, wp->next);
    
    5453
    -                }
    
    5454
    -
    
    5455
    -                wp->next = static_vector_list;
    
    5456
    -                static_vector_list = wp;
    
    5457
    -            } else {
    
    5458
    -                if (debug_static_array_p) {
    
    5459
    -                    printf("  Skip: wp %p value %p header 0x%08lx\n",
    
    5460
    -                           wp, (lispobj *) wp->value, header);
    
    5461
    -                }
    
    5462
    -            }
    
    5463
    -        }
    
    5464
    -        wp = next;
    
    5465
    -    }
    
    5466
    -#endif
    
    5467
    -
    
    5468 5426
         DPRINTF(debug_static_array_p,
    
    5469 5427
                 (stdout, "Phase 2: Visit unused static vectors\n"));
    
    5470 5428
         
    
    ... ... @@ -5475,20 +5433,20 @@ scan_static_vectors(struct weak_pointer *static_vector_list)
    5475 5433
          * visited the static vector, break the weak pointer.
    
    5476 5434
          */
    
    5477 5435
         for (wp = static_vector_list; wp; wp = wp->next) {
    
    5478
    -        lispobj *header = (lispobj *) PTR(wp->value);
    
    5436
    +        lispobj header = *(lispobj *) PTR(wp->value);
    
    5479 5437
     
    
    5480 5438
             DPRINTF(debug_static_array_p,
    
    5481 5439
                     (stdout, "  wp %p value %p header 0x%08lx\n",
    
    5482
    -                 wp, (lispobj *) wp->value, *header));
    
    5440
    +                 wp, (lispobj *) wp->value, header));
    
    5483 5441
     
    
    5484 5442
             /*
    
    5485 5443
              * If the static vector is unused (mark bit clear) and if we
    
    5486 5444
              * haven't seen this vector before, set the visited flag.  If
    
    5487 5445
              * we have visited this vector before, break the weak pointer.
    
    5488 5446
              */
    
    5489
    -        if ((*header & STATIC_VECTOR_MARK_BIT) == 0) {
    
    5447
    +        if ((header & STATIC_VECTOR_MARK_BIT) == 0) {
    
    5490 5448
                 /* Unused static vector */
    
    5491
    -            if ((*header & STATIC_VECTOR_VISITED_BIT) == 0) {
    
    5449
    +            if ((header & STATIC_VECTOR_VISITED_BIT) == 0) {
    
    5492 5450
                     DPRINTF(debug_static_array_p, (stdout, "    Mark vector\n"));
    
    5493 5451
     
    
    5494 5452
                     *header |= STATIC_VECTOR_VISITED_BIT;