[Issue 17698] New: ClassInfo structure is not read-only

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Jul 27 01:17:58 PDT 2017


https://issues.dlang.org/show_bug.cgi?id=17698

          Issue ID: 17698
           Summary: ClassInfo structure is not read-only
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: ibuclaw at gdcproject.org

All generated runtime type information should go in rodata, but for
TypeInfo_Class objects this can't be done as we set the monitor field on it in
synchronized() statements.

Take any example of synchronized(typeid(Foo)) { ... }

Perhaps the __monitor field should be a static slot outside of ClassInfo.  This
may also pave the way for a more pay-as-you-go model too where the monitor is
omitted unless the class declaration is marked with @monitor.

--


More information about the Digitalmars-d-bugs mailing list