std.allocator ready for some abuse

Kapps opantm2+spam at gmail.com
Thu Oct 24 15:19:09 PDT 2013


On Thursday, 24 October 2013 at 19:53:56 UTC, Andrei Alexandrescu 
wrote:
> Hello,
>
>
> I know it's been a long wait. Hopefully it was worth it. The 
> alpha release of untyped allocators is ready for tire-kicking 
> and a test drive.
>
> Code: 
> https://github.com/andralex/phobos/blob/allocator/std/allocator.d
>
> Dox: http://erdani.com/d/phobos-prerelease/std_allocator.html

I admit, I don't use custom allocators as much as I should and am 
not as experienced in this topic as others, yet for my purposes 
this design seems excellent. The docs are solid, and I really 
like the idea of just being able to composite something like 
AllocatorWithStats. The use cases I had in mind (which are 
admittedly quite simple) are covered, and it's very clear how to 
add a custom allocator if desired.

A couple of questions:
Shouldn't most of these implementations be marked nothrow? I 
could be missing something here.
For CAllocator, I notice setting alignment is a property yet does 
not return void. Does this not go against the idea of @property? 
Perhaps it should be setAlignment instead?


More information about the Digitalmars-d mailing list