tech-userlevel archive

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

Re: Improved implementation of *env(3) functions in "libc"

On Mon, Nov 15, 2010 at 07:32:02AM +0000, Matthias Scheler wrote:
> On Mon, Nov 15, 2010 at 09:40:55AM +0900, enami tsugutomo wrote:
> > Matthias Scheler <> writes:
> > 
> > > I've attached a new implementation which remembers the memory blocks
> > > in a seperate tree
> > 
> > Now the scrubing part can be written like mark and sweep gc, ...
> As "environ" is unsorted it would be expensive to look for the memory
> referenced by every tree node.

I think I understand now what you mean:
1.) Iterate over "environ" and mark all RB tree nodes whose memory block
    is still referenced.
2.) Iterate over the RB tree and remove all nodes which aren't marked.

Yes, that's doable. But I don't think I can afford the beer. ;-)

        Kind regards

Matthias Scheler                        

Home | Main Index | Thread Index | Old Index