std.allocator: false pointers

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Fri May 2 11:00:18 PDT 2014


On 5/2/14, 10:33 AM, Steven Schveighoffer wrote:
> On Fri, 02 May 2014 13:26:41 -0400, Steven Schveighoffer
> <schveiguy at yahoo.com> wrote:
>
>> Why not keep the 3 states, but just treat unmarked blocks as free?
>> Then the next time you go through tracing, change the bit to free if
>> it was already marked.
>
> Sorry, if it was already *unmarked* (or marked as garbage).

Yah, understood. Unfortunately I just realized that would require either 
to keep the bits together or to scan two memory areas when trying to 
allocate, both of which have disadvantages. Well, I guess I'll go with 
the post-tracing pass. -- Andrei



More information about the Digitalmars-d mailing list