D-Programming-Language/druntime — pull request #797 by etcimon (2014-05-21 20:08:59+00:00)
Title: Fix cache inconsistency when free'ing from GC

After a pointer is freed, it is not removed from cache thus if it is allocated for another purpose any subsequent realloc calls will refer to the previous size.

This can cause memory corruption with an application that uses `GC.free`, `delete` or `realloc(p, 0)`, or a complete crash if a big allocation's size is cached and the page pool was reduced with minimize, ie. the call to `realloc` will try to resize in-place rather than with malloc.

I also added `USE_CACHE` consistency.