std.expreimantal.allocator deallocate

vitamin vit at vit.vit
Sun Jan 24 16:16:12 UTC 2021


On Sunday, 24 January 2021 at 14:56:25 UTC, Paul Backus wrote:
> On Sunday, 24 January 2021 at 11:00:17 UTC, vitamin wrote:
>> It is Ok when I call deallocate with smaller slice or I need 
>> track exact lengtht?
>
> It depends on the specific allocator, but in general, it is 
> only guaranteed to work correctly if the slice you pass to 
> deallocate is exactly the same as the one you got from allocate.

thanks,
is guaranteed this:

void[] data = Allocator.allocate(data_size);
assert(data.length == data_size)


or can be data.length >= data_size ?


More information about the Digitalmars-d-learn mailing list