[Issue 8536] New: OPTLINK crash with large fixed-size array

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Aug 10 15:43:22 PDT 2012


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

           Summary: OPTLINK crash with large fixed-size array
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Optlink
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2012-08-10 15:43:19 PDT ---
This program:

uint[1 << 24] a;
void main() {}


Gives this error:
test.d(2): Error: index 16777216 overflow for static array



While this program:

struct Foo { uint x; }
Foo[1 << 24] a;
void main() {}


Causes an OPTLINK crash.


I sometimes translate to D some C programs that for performance reasons use
some large global 2D arrays. In D using a global __gshared dynamic array of
dynamic arrays is an option, but this kills some optimizations the compiler is
able to perform thanks to knowing the 2D matrix sizes at compile-time. In my
opinion asking for 50-100 MB static 2D arrays is not that much for a PC with 2+
GB RAM.

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