Changeset 13258


Ignore:
Timestamp:
Dec 8, 2009, 12:36:28 AM (10 years ago)
Author:
gb
Message:

ensure_static_conses() to handle static_cons allocation, interact
with GC policy, etc.

File:
1 edited

Legend:

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

    r13243 r13258  
    24302430    active_dynamic_area->low = new_low;
    24312431  }
     2432  if (g1_area->low == old_low) {
     2433    g1_area->low = new_low;
     2434  }
     2435  if (g1_area->high == old_low) {
     2436    g1_area->high = new_low;
     2437  }
     2438  if (g2_area->low == old_low) {
     2439    g2_area->low = new_low;
     2440  }
     2441  if (g2_area->high == old_low) {
     2442    g2_area->high = new_low;
     2443  }
    24322444  for (i=0, prev=lisp_global(STATIC_CONSES), c=(cons *)new_low;
    24332445       i < n;
     
    24392451  lisp_global(FREE_STATIC_CONSES)+=(n<<fixnumshift);
    24402452}
     2453void
     2454ensure_static_conses(ExceptionInformation *xp, TCR *tcr, natural nconses)
     2455{
     2456  area *a = active_dynamic_area;
     2457  natural nbytes = nconses>>dnode_shift, have;
     2458  BytePtr p = a->high-nbytes;
     2459
     2460  if (p < a->active) {
     2461    untenure_from_area(tenured_area);
     2462    gc_from_xp(xp, 0L);
     2463  }
     2464
     2465  have = unbox_fixnum(lisp_global(FREE_STATIC_CONSES));
     2466  if (have < nconses) {
     2467    if ((a->high-a->active)>nbytes) {
     2468      shrink_dynamic_area(nbytes);
     2469    }
     2470    allocate_static_conses(nconses);
     2471    tcr->bytes_allocated += nbytes;
     2472  }
     2473}
     2474     
Note: See TracChangeset for help on using the changeset viewer.