Freelists and clear/emplace
Dmitry Olshansky
dmitry.olsh at gmail.com
Sat Jun 16 10:09:10 PDT 2012
On 16.06.2012 15:51, Timon Gehr wrote:
> 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.
+1. And I used freelists with raw cast T* and had no trouble either.
(these Ts were PODs, of course)
> Make sure to keep your allocations aligned, though (16 bytes are
> sufficient)
>
> http://d.puremagic.com/issues/show_bug.cgi?id=6635
--
Dmitry Olshansky
More information about the Digitalmars-d
mailing list