[Issue 10323] New: getAMDcacheinfo needlessly allocates

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jun 10 11:55:56 PDT 2013


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

           Summary: getAMDcacheinfo needlessly allocates
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: P2
         Component: druntime
        AssignedTo: nobody at puremagic.com
        ReportedBy: destructionator at gmail.com


--- Comment #0 from Adam D. Ruppe <destructionator at gmail.com> 2013-06-10 11:55:55 PDT ---
src/druntime/src/core/cpuid.d line 544:

        immutable ubyte [] assocmap = [ 0, 1, 2, 0, 4, 0, 8, 0, 16, 0, 32, 48,
64, 96, 128, 0xFF ];


The real problem here is that a array initializer allocates, even if all the
data is static, and the compiler should probably be fixed, but in the mean time
I think we should go ahead and kill as many allocations as possible from
druntime, and this is one of them.

In my experimentation, I found just sticking "static" in front of this line
solved the immediate problem.

-- 
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