std.allocator needs your help

deadalnix deadalnix at gmail.com
Mon Sep 23 10:36:07 PDT 2013


On Monday, 23 September 2013 at 13:58:42 UTC, Andrei Alexandrescu 
wrote:
> If the author forgets and hardcodes a library to use malloc(), 
> I have no way around that.
>

We should consider the lib writer use new and/or automatic 
allocation like for closures. In practice, this is what will 
happen.

> new will still be used to tap into the global shared GC. 
> std.allocator will provide other means of allocating memory.
>

That uterly suck and we can do better using type informations.

> At this point collect() is only implemented by the global GC. 
> It is possible I'll drop it from the final design. However, 
> it's also possible that collect() will be properly defined as 
> "collect all objects allocated within this particular allocator 
> that are not referred from any objects also allocated within 
> this allocator". I think that's a useful definition.
>

I don't think collect is usefull with no type information (not 
even if the data may contain pointers).

> The D language has no idea what a range is. The notion is 
> completely defined in std.range.
>

foreach has some idea of what a range is.


More information about the Digitalmars-d mailing list