Thread overview
[Issue 11446] [GC] GC realloc doesn't ignore non-GC owned pointers
Jan 03, 2019
Rainer Schuetze
January 03, 2019
https://issues.dlang.org/show_bug.cgi?id=11446

Rainer Schuetze <r.sagitario@gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull
                 CC|                            |r.sagitario@gmx.de

--- Comment #1 from Rainer Schuetze <r.sagitario@gmx.de> ---
https://github.com/dlang/druntime/pull/2436

--
January 04, 2019
https://issues.dlang.org/show_bug.cgi?id=11446

--- Comment #2 from github-bugzilla@puremagic.com ---
Commit pushed to master at https://github.com/dlang/druntime

https://github.com/dlang/druntime/commit/e6087c2fed9e49daaa72296bd951ea56efe82ec7 fix Issue 11393,11446 - [GC] GC realloc and free don't ignore interior/non-GC owned pointers

change specification of GC.realloc to something more robust:

- return null for failure (returning the original pointer is no indication of
failure as it might also be returned on success. This can easily lead to
overwriting memory)
- allow freeing old memory immediately (previous implementation did this for
large objects when shrinking)
- only set attribute bits on existing block if reused (previous implementation
didn't set bits if it reused a small block)

refactor realloc to match that spec, add changelog, fix example

--
January 04, 2019
https://issues.dlang.org/show_bug.cgi?id=11446

github-bugzilla@puremagic.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--