Componentizing D's garbage collector

evansl cppljevans at suddenlink.net
Mon Jan 13 14:48:36 PST 2014


On 01/11/14 03:30, Rainer Schuetze wrote:
>
>
> On 10.01.2014 22:42, Andrei Alexandrescu wrote:
[snip]
>> std.emplace will continue to work as a way to build an object at a
>> specified address. I suspect that allocating and manipulating objects on
>> the GC heap in particular may have certain restrictions. One possibility
>> to avoid such restrictions is to have a function typify(T)(void* p)
>> which ascribes type T to heap location p.
>
> That sounds similar to my gc_emplace function. The problematic part is
> how to save that information in the GC.
>
[snip]
Couldn't you store a pointer to the typeinfo within the
allocated memory? IOW, the first part of the allocated memory
would be the typeinfo* followed by the actual memory used to store the
value of the allocated T object.

-regards,
Larry




More information about the Digitalmars-d mailing list