memory management and the standard library

Atila Neves atila.neves at gmail.com
Wed Mar 13 09:05:27 UTC 2019


On Tuesday, 12 March 2019 at 21:12:49 UTC, Sjoerd Nijboer wrote:
> So I pop in every now and then to look how D is progressing, 
> and the last time I concidered D was for a problem a friend of 
> me had with a small game. In that game there was some colission 
> detection that required a custom datastructure and then some 
> operations on top of that, with a hard limit on time.
>
> For this I concidered using D for all its metaprogramming, but 
> I couldn't find how people use manual memory management for 
> common types in the standard library. Is there no way to use 
> custom memory management for types as strings, arrays, every 
> function in the std.algorith module and slices? Am I missing 
> something obvious?
>
> What's the view of the creators of D with regards to custom 
> (manual or gc) memory management for the standard library? C++ 
> Makes a template of about everything that could allocate just 
> so it can extract the allocator. (std::vector for instance) 
> Will D do that too? Will D use a different approach or conclude 
> that this problem only exists for a select few and not the main 
> audience of D?

std.algorithm mostly doesn't care about allocations. I guess one 
*could* want to control how the returned ranges are allocated, 
but I'm not sure how useful that would be.

Otherwise, I wrote this:

https://github.com/atilaneves/automem


More information about the Digitalmars-d mailing list