www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17698] New: ClassInfo structure is not read-only

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 puremagic.com
          Reporter: ibuclaw 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.

--
Jul 27