Bug 23804 – max total size of static arrays

Status
NEW
Severity
normal
Priority
P1
Component
dlang.org
Product
D
Version
D2
Platform
Other
OS
Other
Creation time
2023-03-23T13:26:58Z
Last change time
2024-12-15T15:27:46Z
Assigned to
No Owner
Creator
kdevel
Moved to GitHub: dlang.org#3997 →

Comments

Comment #0 by kdevel — 2023-03-23T13:26:58Z
https://dlang.org/spec/arrays.html "2. The total size of a static array cannot exceed 16Mb" Radio Yerevan was asked: "Is it true that in D static arrays cannot exceed 16Mb?" Radio Yerevan answered: "In principle, yes. But it is not megabits (Mb) but mebibytes (MiB). Furthermore the maximum size of static arrays is int.max bytes (2,147,483,647 B = 2 GiB - 1 B) except for Windows where it is 16 MiB." diff --git a/compiler/src/dmd/target.d b/compiler/src/dmd/target.d index 461e1e9..a3ab681 100644 --- a/compiler/src/dmd/target.d +++ b/compiler/src/dmd/target.d @@ -262,9 +262,9 @@ extern (C++) struct Target if (ptrsize == 4) { /* Optlink cannot deal with individual data chunks - * larger than 16Mb + * larger than 16 MiB */ - maxStaticDataSize = 0x100_0000; // 16Mb + maxStaticDataSize = 0x100_0000; // 16 MiB } } else
Comment #1 by robert.schadek — 2024-12-15T15:27:46Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dlang.org/issues/3997 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB