Freelists and clear/emplace

Timon Gehr timon.gehr at gmx.ch
Sat Jun 16 04:51:36 PDT 2012


On 06/16/2012 03:07 AM, d coder wrote:
> Greetings
>
> Is emplace/clear  mechanism mature enough to be used to create freelists?
>
> I looked but found very scanty documentation on emplace/clear on
> dlang.org <http://dlang.org>.
>
> Regards
> - Puneet
>

I create most of my objects with emplace and have not experienced any 
trouble.

Make sure to keep your allocations aligned, though (16 bytes are sufficient)

http://d.puremagic.com/issues/show_bug.cgi?id=6635


More information about the Digitalmars-d mailing list