Changeset 12806


Ignore:
Timestamp:
Sep 10, 2009, 3:43:00 PM (10 years ago)
Author:
rme
Message:

Scan AREA_WATCHED areas. Un-protect watched areas during GC using new
functions protect_watched_areas() and unprotect_watched_areas().

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

Legend:

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

    r11694 r12806  
    11011101
    11021102  install_weak_mark_functions(lisp_global(WEAK_GC_METHOD) >> fixnumshift);
    1103 
    1104 
    1105 
     1103 
    11061104#ifndef FORCE_DWS_MARK
    11071105  if ((natural) (tcr->cs_limit) == CS_OVERFLOW_FORCE_LIMIT) {
     
    11631161
    11641162  get_time(start);
     1163
     1164  /* The link-inverting marker might need to write to watched areas */
     1165  unprotect_watched_areas(PROT_READ|PROT_EXEC|PROT_WRITE);
     1166
    11651167  lisp_global(IN_GC) = (1<<fixnumshift);
    11661168
     
    12381240
    12391241        case AREA_STATIC:
     1242        case AREA_WATCHED:
    12401243        case AREA_DYNAMIC:                  /* some heap that isn't "the" heap */
    12411244          /* In both of these cases, we -could- use the area's "markbits"
     
    13731376
    13741377        case AREA_STATIC:
     1378        case AREA_WATCHED:
    13751379        case AREA_DYNAMIC:                  /* some heap that isn't "the" heap */
    13761380          if (next_area->younger == NULL) {
     
    13841388      }
    13851389    }
    1386  
     1390
    13871391    if (GCephemeral_low) {
    13881392      forward_memoized_area(tenured_area, area_dnode(a->low, tenured_area->low));
     
    14281432 
    14291433  lisp_global(IN_GC) = 0;
     1434 
     1435  protect_watched_areas();
    14301436
    14311437  nrs_GC_EVENT_STATUS_BITS.vcell |= gc_postgc_pending;
  • trunk/source/lisp-kernel/memory.c

    r11986 r12806  
    948948  pure_space_active = pure_space_start;
    949949}
     950
     951void
     952protect_watched_areas()
     953{
     954  area *a = active_dynamic_area;
     955  natural code = a->code;
     956
     957  while (code != AREA_VOID) {
     958    if (code == AREA_WATCHED) {
     959      natural size = a->high - a->low;
     960     
     961      ProtectMemory(a->low, size);
     962    }
     963    a = a->succ;
     964    code = a->code;
     965  }
     966}
     967
     968void
     969unprotect_watched_areas()
     970{
     971  area *a = active_dynamic_area;
     972  natural code = a->code;
     973
     974  while (code != AREA_VOID) {
     975    if (code == AREA_WATCHED) {
     976      natural size = a->high - a->low;
     977     
     978      UnProtectMemory(a->low, size);
     979    }
     980    a = a->succ;
     981    code = a->code;
     982  }
     983}
Note: See TracChangeset for help on using the changeset viewer.