Bug 15187 – dispose for allocators is broken

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-10-11T17:03:00Z
Last change time
2016-01-03T14:14:36Z
Assigned to
nobody
Creator
ilyayaroshenko

Comments

Comment #0 by ilyayaroshenko — 2015-10-11T17:03:52Z
Current code: ================ void dispose(A, T)(auto ref A alloc, T* p) { static if (hasElaborateDestructor!T) { destroy(*p); } alloc.deallocate(p[0 .. T.sizeof]); } Should be: ================ void dispose(A, T)(auto ref A alloc, T* p) { static if (hasElaborateDestructor!T) { destroy(*p); } alloc.deallocate((cast(void*)p)[0 .. T.sizeof]); }
Comment #1 by ilyayaroshenko — 2015-10-11T17:35:12Z
Comment #2 by github-bugzilla — 2015-10-14T23:09:15Z
Comment #3 by github-bugzilla — 2015-10-14T23:18:22Z
Commit pushed to stable at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/0422e29c7edd6fb807dcf878e78d1d3007a6e34b Merge pull request #3711 from 9il/patch-3 [DMD 2.069][allocators] Fix issue 15187
Comment #4 by github-bugzilla — 2015-10-28T10:30:56Z
Comment #5 by github-bugzilla — 2016-01-03T14:14:36Z