Bug 13558 – GC.free does not work for array pointers of larger size

Status
NEW
Severity
normal
Priority
P3
Component
druntime
Product
D
Version
D2
Platform
All
OS
Linux
Creation time
2014-09-30T16:01:06Z
Last change time
2024-12-07T13:34:16Z
Assigned to
Dicebot
Creator
Dicebot
Moved to GitHub: dmd#17134 →

Comments

Comment #0 by public — 2014-09-30T16:01:06Z
Original NG topic : http://forum.dlang.org/post/[email protected] This code does not actually free anything: ``` void main() { ubyte[] result; result.length = 4096; GC.free(result.ptr); } ``` This happens because for larger size blocks capacity is stored in the beginning of the memory block making actual `array.ptr` interior pointer. Interior pointers are ignored by GC.free There are several possible ways for fixing this that are being considered right now.
Comment #1 by robert.schadek — 2024-12-07T13:34:16Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17134 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB