Heads-up: upcoming instabilities in std.experimental.allocator, and what to do

Kagamin spam at here.lot
Fri Dec 1 09:51:03 UTC 2017


On Thursday, 30 November 2017 at 19:01:02 UTC, Andrei 
Alexandrescu wrote:
> Currently, allocators traffic in void[]. When I first designed 
> allocators, I considered using ubyte[] instead.

I experimented with using byte[] for opaque buffers, because byte 
is signed, one can't parse byte[] content in a meaningful way, 
and should cast to ubyte[] first, so byte[] is practically opaque 
(if you're careful).

> However, using void[] makes it difficult to express the fact 
> that allocate() is a safe function for virtual all allocators.

Safe code should only use typed allocation (make) and never see 
underlying implementation.


More information about the Digitalmars-d mailing list