[Issue 10048] New: TypeInfo comparison allocates memory

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed May 8 11:09:50 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10048

           Summary: TypeInfo comparison allocates memory
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: druntime
        AssignedTo: nobody at puremagic.com
        ReportedBy: code at dawg.eu


--- Comment #0 from Martin Nowak <code at dawg.eu> 2013-05-08 11:09:49 PDT ---
The current implementation of TypeInfo.opEquals is very naive. It calls
TypeInfo.toString on both operands and compares the resulting strings. The main
problem is that this allocates memory for each comparison.

Another issue is that it may result in false positive comparisons, e.g. when
comparing .classinfo of a class and it's updated version.

related:
https://github.com/D-Programming-Language/druntime/pull/370
https://github.com/D-Programming-Language/druntime/pull/438

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list