Summary: No stack allocation for "scope c = new class Object
           Product: D
           Version: 1.044
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: performance
          Severity: normal
          Priority: P2
         Component: DMD

(Found in 1.045, but that isn't in the version list)

In the following code 'bar' is heap-allocated even though it's "scope bar = new
void foo() {
    scope bar = new class Object {}; // on heap

If the class is given a name then it's stack-allocated:
void foo() {
    class Anon : Object {}
    scope bar = new Anon;            // on stack

(Look at the disassembled output to see the difference)

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to