Due to the size calculation used in all array length related GC functions excessive allocation requests like long[] l = new long[size_t.max]; allocate "(element_size * element_count) & 0xFFFF_FFFF" bytes and not "element_size * element_count" bytes. Even non-excessive requests like byte[] b = new byte[size_t.max / 3]; fail with a segfault because bigAlloc uses "assert (0)" instead of "_d_OutOfMemory".
Fixed DMD 1.014
int main() { size_t len = size_t.max-100; ubyte[] arr = new ubyte[len]; return 0; } Return code: 11 (Segmentation fault) Tried only on dpaste.
This is unlikely a recent regression, it's already in dmd 2.067. https://github.com/D-Programming-Language/druntime/pull/1528
Commit pushed to master at https://github.com/D-Programming-Language/druntime https://github.com/D-Programming-Language/druntime/commit/6dbe4d82c074561ddb23525b23cd9cf599e4a5ce Merge pull request #1528 from rainers/fix_1180 Fix Issue 1180 - the GC failes to handle large allocation requests propperly
Commit pushed to stable at https://github.com/dlang/druntime https://github.com/dlang/druntime/commit/6dbe4d82c074561ddb23525b23cd9cf599e4a5ce Merge pull request #1528 from rainers/fix_1180
Commit pushed to dmd-cxx at https://github.com/dlang/druntime https://github.com/dlang/druntime/commit/6dbe4d82c074561ddb23525b23cd9cf599e4a5ce Merge pull request #1528 from rainers/fix_1180
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル