On 3/3/2015 9:44 AM, Andrei Alexandrescu wrote:
On 3/3/15 9:40 AM, "Marc =?UTF-8?B?U2Now7x0eiI=?= <[email protected]>" wrote:
All instances need to carry a pointer to refcount anyway, so the
freelist could just be stored next to the refcount. The idea of creating
that list, however, is more worrying, because it again involves
allocations. It can get arbitrarily long.
No, the cool thing about freelists is they use free memory to chain things
together.

I don't think the payload memory can be repurposed to be a free list until the destructor runs, because the whole problem is the payload may still be live to some references to it.

Reply via email to