A few thoughts on std.allocator

Timon Gehr via Digitalmars-d digitalmars-d at puremagic.com
Tue May 12 13:50:21 PDT 2015


On 05/12/2015 05:52 PM, Steven Schveighoffer wrote:
> On 5/10/15 8:58 AM, Timon Gehr wrote:
>> On 05/10/2015 11:50 AM, Andrei Alexandrescu wrote:
>>> In C, C++, and D people have allocated memory for a long time in the
>>> following manner:
>>> ...
>>> Long story short, arrays should sit on a different heap than objects.
>>> ...
>>
>> Unless this has been fixed in the interim, I believe DMD lowers new
>> S(args) to [S(args)].ptr for struct S. It should be ensured that the
>> global allocator will not be misinformed about the kind of allocation
>> that takes place, by removing this lowering.
>
> That has been fixed. The compiler now calls a different runtime hook.
>
> -Steve

Great.


More information about the Digitalmars-d mailing list