Changeset 756


Ignore:
Timestamp:
Apr 2, 2004, 9:53:02 PM (21 years ago)
Author:
Gary Byers
Message:

Hysteresis in stack-overflow recovery. (Needs testing.)

File:
1 edited

Legend:

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

    r662 r756  
    599599}
    600600
     601/*
     602  Lower (move toward 0) the "end" of the soft protected area associated
     603  with a by a page, if we can.
     604*/
     605
     606void
     607adjust_soft_protection_limit(area *a)
     608{
     609  char *proposed_new_soft_limit = a->softlimit - 4096;
     610  protected_area_ptr p = a->softprot;
     611 
     612  if (proposed_new_soft_limit >= (p->start+16384)) {
     613    p->end = proposed_new_soft_limit;
     614    p->protsize = p->end-p->start;
     615    a->softlimit = proposed_new_soft_limit;
     616  }
     617  protect_area(p);
     618}
     619
    601620void
    602621restore_soft_stack_limit(unsigned stkreg)
     
    608627  case sp:
    609628    a = tcr->cs_area;
     629    if ((a->softlimit - 4096) > (a->hardlimit + 16384)) {
     630      a->softlimit -= 4096;
     631    }
    610632    tcr->cs_limit = (LispObj)ptr_to_lispobj(a->softlimit);
    611633    break;
    612634  case vsp:
    613635    a = tcr->vs_area;
    614     protect_area(a->softprot);
     636    adjust_soft_protection_limit(a);
    615637    break;
     638  case tsp:
     639    a = tcr->ts_area;
     640    adjust_soft_protection_limit(a);
    616641  }
    617642}
Note: See TracChangeset for help on using the changeset viewer.