[Issue 6771] New: Jagged array and init causing DMD to take a LONG time to compile.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Oct 5 07:38:21 PDT 2011


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

           Summary: Jagged array and init causing DMD to take a LONG time
                    to compile.
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Windows
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: damianday at hotmail.co.uk


--- Comment #0 from Damian <damianday at hotmail.co.uk> 2011-10-05 07:37:37 PDT ---
const MAXX = 40;
const MAXY = 40;

struct MyStruct
{
   ushort Var1;
   ushort Var2;
   ushort Var3;
   // NOTE: comment out these variables below and it
   // will compile faster..
   ubyte Var4;
   ubyte Var5;
   ubyte Var6;
   ubyte Var7;
   ubyte Var8;
   ubyte Var9;
}

public class MyClass
{
   public MyStruct[MAXX * 3][MAXY * 3] MArr;

   public this()
   {
      MArr = MArr.init; // <-- THIS LINE
   }
}

The above source code will cause the DMD compiler to take a long time to
compile (minutes? hours?). Commenting out the lines suggested will speed the
compilation up enough to see it succeed.

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