std.allocator: false pointers
Steven Schveighoffer via Digitalmars-d
digitalmars-d at puremagic.com
Fri May 2 11:50:50 PDT 2014
On Fri, 02 May 2014 14:42:52 -0400, Andrei Alexandrescu
<SeeWebsiteForEmail at erdani.org> wrote:
> On 5/2/14, 11:07 AM, Steven Schveighoffer wrote:
>> What is the problem with keeping the bits together?
>
> More implementation (I have a BitVector type but not a KBitsVector!k
> type), and scanning can't be done with fast primitives. -- Andrei
Given a bitvector type, a 2bitvector type can be implemented on top of it.
If one bit is "free", and another is "garbage", you just have to look for
any set bits for free blocks. Yes, you have to look through 2x as much
memory, but only until you find a free block.
-Steve
More information about the Digitalmars-d
mailing list