numpy/numpy — pull request #4841 by juliantaylor (2014-07-05 21:14:04+00:00)
Title: BUG: disable garbage collector during memory allocation hook

When a cython object contains numpy arrays the pure python allocation
hook can trigger during cythons __dealloc__ method and trigger a second
deletion of the object currently being deleted.
To minimize the probabily that that happens disable the garbage
collector during the hook.
As this involves python calls it is still possible that a double delete
occurs but chances are lowered, a proper solution would be C only hook
like python 3.4 tracemalloc module.

Closes gh-4834