std.allocator needs your help

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun Sep 22 19:00:39 PDT 2013


On 9/22/13 6:34 PM, Nicholas Londey wrote:
>> * allocate(s) returns a ubyte[] with length at least s, or null. (It
>> does not throw on out-of-memory because that would hurt composability;
>> it turns out many elemental allocators do naturally run out of
>> memory.) This method is required for all allocators. In most
>> allocators this method should be @safe.
>
> Would an 'expected' be a possible alternative to returning null?
>
> Am a big fan of this talk of yours.
> http://channel9.msdn.com/Shows/Going+Deep/C-and-Beyond-2012-Andrei-Alexandrescu-Systematic-Error-Handling-in-C

Thanks! I think expected would be appropriate for the high-level allocator.

Andrei



More information about the Digitalmars-d mailing list