[Issue 14912] Move initialisation of GC'd struct and class data from the callee to the caller
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Fri Aug 14 05:44:57 PDT 2015
https://issues.dlang.org/show_bug.cgi?id=14912
--- Comment #6 from Steven Schveighoffer <schveiguy at yahoo.com> ---
Why would a template need memcpy?
T *_d_newitem(T)()
{
// could eliminate typeid here
T *result = cast(T *)GC.malloc(T.sizeof, typeid(T).flags);
*result = T.init;
return result;
}
--
More information about the Digitalmars-d-bugs
mailing list