Back to index

plt-scheme  4.2.1
Functions | Variables
blacklst.c File Reference
#include "private/gc_priv.h"

Go to the source code of this file.

Functions

void GC_clear_bl ()
void GC_default_print_heap_obj_proc (ptr_t p)
void GC_print_heap_obj GC_PROTO ((ptr_t p))
void GC_print_source_ptr (ptr_t p)
void GC_bl_init ()
void GC_clear_bl (word *doomed)
void GC_copy_bl (word *old, word *new)
static word total_stack_black_listed ()
void GC_promote_black_lists ()
void GC_unpromote_black_lists ()
void GC_add_to_black_list_normal (word p)
void GC_add_to_black_list_stack (word p)
struct hblkGC_is_black_listed (struct hblk *h, word len)
word GC_number_stack_black_listed (struct hblk *start, struct hblk *endp1)

Variables

wordGC_old_normal_bl
wordGC_incomplete_normal_bl
wordGC_old_stack_bl
wordGC_incomplete_stack_bl
word GC_total_stack_black_listed
word GC_black_list_spacing = MINHINCR*HBLKSIZE

Function Documentation

Definition at line 176 of file blacklst.c.

{
    if (!(GC_modws_valid_offsets[p & (sizeof(word)-1)])) return;
    {
        register int index = PHT_HASH(p);
        
        if (HDR(p) == 0 || get_pht_entry_from_index(GC_old_normal_bl, index)) {
#          ifdef PRINT_BLACK_LIST
              if (!get_pht_entry_from_index(GC_incomplete_normal_bl, index)) {
                GC_err_printf2(
                     "Black listing (normal) 0x%lx referenced from 0x%lx ",
                      (unsigned long) p, (unsigned long) source);
                GC_print_source_ptr(source);
                GC_err_puts("\n");
              }
#           endif
            set_pht_entry_from_index(GC_incomplete_normal_bl, index);
        } /* else this is probably just an interior pointer to an allocated */
          /* object, and isn't worth black listing.                       */
    }
}

Here is the call graph for this function:

Definition at line 205 of file blacklst.c.

{
    register int index = PHT_HASH(p);
        
    if (HDR(p) == 0 || get_pht_entry_from_index(GC_old_stack_bl, index)) {
#      ifdef PRINT_BLACK_LIST
           if (!get_pht_entry_from_index(GC_incomplete_stack_bl, index)) {
                GC_err_printf2(
                     "Black listing (stack) 0x%lx referenced from 0x%lx ",
                      (unsigned long)p, (unsigned long)source);
                GC_print_source_ptr(source);
                GC_err_puts("\n");
           }
#       endif
       set_pht_entry_from_index(GC_incomplete_stack_bl, index);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 86 of file blacklst.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

void GC_clear_bl ( word doomed)

Definition at line 111 of file blacklst.c.

{
    BZERO(doomed, sizeof(page_hash_table));
}
void GC_copy_bl ( word old,
word new 
)

Definition at line 117 of file blacklst.c.

{
    BCOPY(old, new, sizeof(page_hash_table));
}

Here is the caller graph for this function:

Definition at line 58 of file blacklst.c.

{
    ptr_t base = GC_base(p);

    GC_err_printf2("start: 0x%lx, appr. length: %ld", base, GC_size(base));
}

Here is the call graph for this function:

Here is the caller graph for this function:

struct hblk* GC_is_black_listed ( struct hblk h,
word  len 
) [read]

Definition at line 233 of file blacklst.c.

{
    register int index = PHT_HASH((word)h);
    register word i;
    word nblocks = divHBLKSZ(len);

    if (!GC_all_interior_pointers) {
      if (get_pht_entry_from_index(GC_old_normal_bl, index)
          || get_pht_entry_from_index(GC_incomplete_normal_bl, index)) {
        return(h+1);
      }
    }
    
    for (i = 0; ; ) {
        if (GC_old_stack_bl[divWORDSZ(index)] == 0
            && GC_incomplete_stack_bl[divWORDSZ(index)] == 0) {
            /* An easy case */
            i += WORDSZ - modWORDSZ(index);
        } else {
          if (get_pht_entry_from_index(GC_old_stack_bl, index)
              || get_pht_entry_from_index(GC_incomplete_stack_bl, index)) {
            return(h+i+1);
          }
          i++;
        }
        if (i >= nblocks) break;
        index = PHT_HASH((word)(h+i));
    }
    return(0);
}

Here is the caller graph for this function:

Definition at line 270 of file blacklst.c.

{
    register struct hblk * h;
    word result = 0;
    
    for (h = start; h < endp1; h++) {
        register int index = PHT_HASH((word)h);
        
        if (get_pht_entry_from_index(GC_old_stack_bl, index)) result++;
    }
    return(result);
}

Here is the caller graph for this function:

Definition at line 70 of file blacklst.c.

{
    ptr_t base = GC_base(p);
    if (0 == base) {
       if (0 == p) {
           GC_err_printf0("in register");
       } else {
           GC_err_printf0("in root set");
       }
    } else {
       GC_err_printf0("in object at ");
       (*GC_print_heap_obj)(base);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 127 of file blacklst.c.

{
    word * very_old_normal_bl = GC_old_normal_bl;
    word * very_old_stack_bl = GC_old_stack_bl;
    
    GC_old_normal_bl = GC_incomplete_normal_bl;
    GC_old_stack_bl = GC_incomplete_stack_bl;
    if (!GC_all_interior_pointers) {
      GC_clear_bl(very_old_normal_bl);
    }
    GC_clear_bl(very_old_stack_bl);
    GC_incomplete_normal_bl = very_old_normal_bl;
    GC_incomplete_stack_bl = very_old_stack_bl;
    GC_total_stack_black_listed = total_stack_black_listed();
#   ifdef PRINTSTATS
       GC_printf1("%ld bytes in heap blacklisted for interior pointers\n",
                 (unsigned long)GC_total_stack_black_listed);
#   endif
    if (GC_total_stack_black_listed != 0) {
        GC_black_list_spacing =
              HBLKSIZE*(GC_heapsize/GC_total_stack_black_listed);
    }
    if (GC_black_list_spacing < 3 * HBLKSIZE) {
       GC_black_list_spacing = 3 * HBLKSIZE;
    }
    if (GC_black_list_spacing > MAXHINCR * HBLKSIZE) {
       GC_black_list_spacing = MAXHINCR * HBLKSIZE;
       /* Makes it easier to allocate really huge blocks, which otherwise */
       /* may have problems with nonuniform blacklist distributions.     */
       /* This way we should always succeed immediately after growing the */ 
       /* heap.                                                   */
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void GC_print_heap_obj GC_PROTO ( (ptr_t p )

Definition at line 161 of file blacklst.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static word total_stack_black_listed ( ) [static]

Definition at line 286 of file blacklst.c.

{
    register unsigned i;
    word total = 0;
    
    for (i = 0; i < GC_n_heap_sects; i++) {
       struct hblk * start = (struct hblk *) GC_heap_sects[i].hs_start;
       word len = (word) GC_heap_sects[i].hs_bytes;
       struct hblk * endp1 = start + len/HBLKSIZE;
       
       total += GC_number_stack_black_listed(start, endp1);
    }
    return(total * HBLKSIZE);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 51 of file blacklst.c.

Definition at line 43 of file blacklst.c.

Definition at line 47 of file blacklst.c.

Definition at line 40 of file blacklst.c.

Definition at line 46 of file blacklst.c.

Definition at line 49 of file blacklst.c.