FYI - mo' work on std.allocator

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Sun Apr 27 08:31:17 PDT 2014


On 4/27/14, 3:58 AM, "Marc Schütz" <schuetzm at gmx.net>" wrote:
> I have a question regarding `owns`:
>
>      bool owns(void[] b);
>
> The documentation states it should return true if b has been allocated
> with this allocator. But what should happen if a sub-slice of an
> allocated object is passed? Or when a slice is passed that
> contains/overlaps an object belonging to the allocator?

Behavior is dependent on the allocator. Only full blocks (returned by 
allocate()) are guaranteed. -- Andrei


More information about the Digitalmars-d mailing list