Changeset 5951


Ignore:
Timestamp:
Feb 21, 2007, 12:58:51 PM (13 years ago)
Author:
gb
Message:

If full GC is deferred, ensure that a full GC happens after
WITHOUT-GCING exits.

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

Legend:

Unmodified
Added
Removed
  • trunk/ccl/lisp-kernel/ppc-exceptions.c

    r5635 r5951  
    364364}
    365365
     366natural gc_deferred = 0, full_gc_deferred = 0;
     367
    366368OSStatus
    367369handle_gc_trap(ExceptionInformation *xp, TCR *tcr)
     
    372374  area *a = active_dynamic_area;
    373375  Boolean egc_was_enabled = (a->older != NULL);
     376  natural gc_previously_deferred = gc_deferred;
    374377
    375378
     
    416419
    417420    if (selector == GC_TRAP_FUNCTION_IMMEDIATE_GC) {
    418       gc_from_xp(xp, 0L);
    419       break;
     421      if (!full_gc_deferred) {
     422        gc_from_xp(xp, 0L);
     423        break;
     424      }
     425      /* Tried to do a full GC when gc was disabled.  That failed,
     426         so try full GC now */
     427      selector = GC_TRAP_FUNCTION_GC;
    420428    }
    421429   
     
    424432    }
    425433    gc_from_xp(xp, 0L);
     434    if (gc_deferred > gc_previously_deferred) {
     435      full_gc_deferred = 1;
     436    } else {
     437      full_gc_deferred = 0;
     438    }
    426439    if (selector > GC_TRAP_FUNCTION_GC) {
    427440      if (selector & GC_TRAP_FUNCTION_IMPURIFY) {
     
    680693    }
    681694    resume_other_threads(true);
     695    gc_deferred++;
    682696    return 0;
    683697  }
     698  gc_deferred = 0;
    684699
    685700  gc_tcr = tcr;
  • trunk/ccl/lisp-kernel/x86-exceptions.c

    r5616 r5951  
    141141}
    142142
     143natural gc_deferred = 0, full_gc_deferred = 0;
     144
    143145Boolean
    144146handle_gc_trap(ExceptionInformation *xp, TCR *tcr)
     
    149151  area *a = active_dynamic_area;
    150152  Boolean egc_was_enabled = (a->older != NULL);
     153  natural gc_previously_deferred = gc_deferred;
    151154
    152155  switch (selector) {
     
    192195
    193196    if (selector == GC_TRAP_FUNCTION_IMMEDIATE_GC) {
    194       gc_from_xp(xp, 0L);
    195       break;
     197      if (!full_gc_deferred) {
     198        gc_from_xp(xp, 0L);
     199        break;
     200      }
     201      /* Tried to do a full GC when gc was disabled.  That failed,
     202         so try full GC now */
     203      selector = GC_TRAP_FUNCTION_GC;
    196204    }
    197205   
     
    200208    }
    201209    gc_from_xp(xp, 0L);
     210    if (gc_deferred > gc_previously_deferred) {
     211      full_gc_deferred = 1;
     212    } else {
     213      full_gc_deferred = 0;
     214    }
    202215    if (selector & GC_TRAP_FUNCTION_PURIFY) {
    203216      purify_from_xp(xp, 0L);
     
    16401653TCR *gc_tcr = NULL;
    16411654
     1655
    16421656int
    16431657gc_like_from_xp(ExceptionInformation *xp,
     
    16571671    }
    16581672    resume_other_threads(true);
     1673    gc_deferred++;
    16591674    return 0;
    16601675  }
     1676  gc_deferred = 0;
    16611677
    16621678  gc_tcr = tcr;
Note: See TracChangeset for help on using the changeset viewer.