www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21277] New: TypeInfo.initializer() is the wrong abstraction,


          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



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.

Sep 25 2020