Boost logo

Boost :

From: John Max Skaller (skaller_at_[hidden])
Date: 2001-05-03 10:08:44


scleary_at_[hidden] wrote:

> But note that my solution is able to side-step this issue because Pool
> doesn't keep *any* information about allocated chunks. Your problem can use
> a similar solution, but only if you go to a footer instead of a header,

        That won't work. The information stored in the header is:

        1) a link to the next block
        2) a pointer to a shape descriptor
        3) a flag for use in the mark/sweep phase of collection

The shape descriptor consists of:

        1) the size of the block
        2) a finalisation routine
        3) the number of managed pointers
        4) offsets to the managed pointers

So you see that the only way to find the size of the block,
so as to locate the footer, is to already know the address
of the footer so as to get the shape descriptor, and thus
the size of the block :-)

-- 
John (Max) Skaller, mailto:skaller_at_[hidden]
10/1 Toxteth Rd Glebe NSW 2037 Australia voice: 61-2-9660-0850
checkout Vyper http://Vyper.sourceforge.net
download Interscript http://Interscript.sourceforge.net

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk