September 25, 2020 [Issue 21277] New: TypeInfo.initializer() is the wrong abstraction, should be TypeInfo.initialize(void*) | ||||
---|---|---|---|---|
| ||||
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@puremagic.com Reporter: andrei@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. -- |
Copyright © 1999-2021 by the D Language Foundation