[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GC questions



> Date: Mon, 25 Feb 91 10:50+0100
> From: Anton Beschta <toni%l4@ztivax.siemens.com>
> 
>     Date: Fri, 22 Feb 91 10:41:05 
>     From: moon%brazil.cambridge.apple.com@ztivax (David A. Moon)
> 
>     > Date: Fri, 22 Feb 91 14:55+0100
>     > From: toni%l4@ztivax.siemens.com (Anton Beschta)
>     > 
>     > Question 3:
>     > Is there a way to change the gc behavior of an area from :static to
>     > :dynamic
> 
>     The documented way to do this works.

I have to apologize.  The whole GC was rewritten since I last looked at it and
the way I was thinking of doesn't even exist anymore.  All I can say in my
defense is that it worked the last time I tried it, which must have been
several years ago.  I'd better stop assuming I know what I'm talking about
without verifying my facts first.

As far as I can tell it is now impossible to do what you want using
documented interfaces.  I guess the person who rewrote it didn't think
that was something you ought to do.  What you're doing would be the new
way to do it, using MAKE-AREA, except what you're doing doesn't affect
objects that already exist.  It only changes the status of new regions
added to the area afterwards.

To make up for my earlier misinformation, here is the call to undocumented
interfaces that does what you want.  I don't know if this still works in
Genera 8.1, nor whether a documented interface for GC'ing a static area
has been provided in Genera 8.1.  I have only tested this form on an
Ivory in 8.0.1 but I believe it works on a 3600 also.

(let ((area-mask (make-array (si:n-areas) :initial-element nil))
      (level-mask (make-array sys:%number-of-levels :initial-element nil)))
  (setf (aref area-mask tv:bit-array-area) t)
  (setf (aref level-mask sys:%static-level) t)
  (si:immediate-gc :area-mask area-mask :level-mask level-mask :verbose t))

The meaning of this form is to run a garbage collection, reclaiming only
objects that are in the area tv:bit-array-area and are static.