Changeset 13881


Ignore:
Timestamp:
Jun 24, 2010, 11:52:00 AM (9 years ago)
Author:
gb
Message:

Do GC notification if dynamic heap shrinks in ensure_static_conses().

File:
1 edited

Legend:

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

    r13792 r13881  
    22932293  natural nbytes = nconses>>dnode_shift, have;
    22942294  BytePtr p = a->high-nbytes;
     2295  Boolean crossed_notify_threshold = false;
     2296  LispObj before_shrink, after_shrink;
    22952297
    22962298  if (p < a->active) {
    22972299    untenure_from_area(tenured_area);
    22982300    gc_from_xp(xp, 0L);
     2301    did_gc_notification_since_last_full_gc = false;
    22992302  }
    23002303
    23012304  have = unbox_fixnum(lisp_global(FREE_STATIC_CONSES));
    23022305  if (have < nconses) {
    2303     if ((a->high-a->active)>nbytes) {
     2306    before_shrink = a->high-a->active;
     2307    if (before_shrink>nbytes) {
    23042308      shrink_dynamic_area(nbytes);
     2309      after_shrink = a->high-a->active;
     2310      if ((before_shrink >= lisp_heap_notify_threshold) &&
     2311          (after_shrink < lisp_heap_notify_threshold)) {
     2312        crossed_notify_threshold = true;
     2313      }
    23052314    }
    23062315    allocate_static_conses(nconses);
    23072316    tcr->bytes_allocated += nbytes;
    23082317  }
     2318  if (crossed_notify_threshold && !did_gc_notification_since_last_full_gc) {
     2319    callback_for_gc_notification(xp,tcr);
     2320  }
    23092321}
    23102322     
Note: See TracChangeset for help on using the changeset viewer.