FYI - mo' work on std.allocator

Brian Schott via Digitalmars-d digitalmars-d at puremagic.com
Mon May 5 17:30:09 PDT 2014


On Sunday, 27 April 2014 at 05:43:07 UTC, Andrei Alexandrescu 
wrote:
> Added SbrkRegion, SimpleBlocklist, and Blocklist.
>
> http://erdani.com/d/phobos-prerelease/std_allocator.html#.SbrkRegion
> http://erdani.com/d/phobos-prerelease/std_allocator.html#.SimpleBlocklist
> http://erdani.com/d/phobos-prerelease/std_allocator.html#.Blocklist
>
> https://github.com/andralex/phobos/blob/allocator/std/allocator.d
>
> Destruction is as always welcome. I plan to get into tracing 
> tomorrow morning.
>
>
> Andrei

These are my biggest concerns with the allocator API:

1. Struct postblit/destructors don't work reliably, so knowing 
when to call deallocate() is very difficult.

2. As hard as I try, I still end up with the only references to 
GC-allocated memory being in my allocator-backed containers. The 
GC frees all sorts of memory that it shoudn't. It's a giant game 
af whack-a-mole trying to find the GC memory, which leads me to:

3. GC.removeRange is one of the slowest functions I've ever used. 
My allocator-backed binary tree implementation took 14 seconds to 
load a very large data set (compared to RedBlackTree's 35 
seconds) and then spent the next five minutes in GC.removeRange 
before I got bored and killed it.


More information about the Digitalmars-d mailing list