[Issue 14126] GITHEAD - GC seemingly corrupting memory

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Feb 6 04:13:59 PST 2015


https://issues.dlang.org/show_bug.cgi?id=14126

--- Comment #11 from Ketmar Dark <ketmar at ketmar.no-ip.org> ---
seems that the bug is due to the code in `lifetime.d:finalize_array2()`.

for big blocks (those which are bigger or equal to PAGESIZE), it does this: `p
+= LARGEPAD;`, and LARGEPAD is:

  LARGEPREFIX = 16, // 16 bytes padding at the front of the array
  LARGEPAD = LARGEPREFIX + 1,

seems that LARGEPAD must be used only in overall block size calculations, but
not as real padding (real padding is LARGEPREFIX in this case).

yet i'm not an expert in D memory management, so i can't say if i'm really
right here. fixing `lifetime.d:finalize_array2()` to use `LARGEPREFIX` instead
seems to fix the bug. and hey, why anoyone would use 17-byte PREFIX padding
anyway?

--


More information about the Digitalmars-d-bugs mailing list