[Issue 21277] New: TypeInfo.initializer() is the wrong abstraction, should be TypeInfo.initialize(void*)
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Sep 25 15:17:13 UTC 2020
https://issues.dlang.org/show_bug.cgi?id=21277
Issue ID: 21277
Summary: TypeInfo.initializer() is the wrong abstraction,
should be TypeInfo.initialize(void*)
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: andrei at erdani.com
Currently:
https://dlang.org/library/object/type_info.initializer.html
This assumes every object is initialized by memcpying an array onto it. This
makes it impossible to optimize initialization of objects with "= void" fields.
The right abstraction is a method:
void initialize(void* address);
which creates a properly initialized object at address. That allows optimal
initialization of objects with = void fields and may also save memory for all
those static initializer arrays.
--
More information about the Digitalmars-d-bugs
mailing list