On Tue, Dec 17, 2002 at 11:49:50PM -0800, Steve Fink wrote: > As a more concrete demonstration of what I'm talking about, here's an > implementiation of the easy part: the pinning and releasing macros. > (UNPIN would probably be better than RELEASE, huh?) It's a naive > implementation with a low fixed limit on the max number of pinned > objects (10), but at least it's fairly fast. Pinned PMCs could > probably be better done as a prebuilt prefix to the next_for_GC list.
I don't know how relevant this thought is, but it should be possible to make a dynamic list of such objects, provided it always has at least one free slot maintained at all times. If the pinning routine finds it is about to fill the free slot, then it pins the thing passed in, and immediately allocates more space. This might trigger GC, but it's safe as everything is pinned :-) Nicholas Clark