std.experimental.allocator

ryuukk_ ryuukk.dev at gmail.com
Sun Aug 13 15:41:15 UTC 2023


On Sunday, 13 August 2023 at 15:25:16 UTC, Richard (Rikki) Andrew 
Cattermole wrote:
> Mine (-betterC) 
> https://github.com/Project-Sidero/basic_memory/tree/main/source/sidero/base/allocators
>
> Similar scope to one in Phobos.
>
> On that note I'm still waiting a year+ for Atila to get back to 
> me about talking about where to go for 
> std.experimental.allocators.

It's almost good, unfortunately it uses RAII.. wich is a red flag 
for me

The premise of an Allocator API is to give control to the user, 
this is lost

Also, i'd personally remove this import: ``import std.typecons : 
Ternary;``, no need to tap into std just for this struct


https://github.com/dlang/phobos/blob/v2.105.0/std/typecons.d#L10472


Mine does't use RAII, and i personally think this is what a good 
core API should be


More information about the Digitalmars-d-learn mailing list