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