Skip to content

Conversation

@vstinner
Copy link
Member

@vstinner vstinner commented Apr 11, 2019

Rename _PyMem_IsFreed() function to _PyMem_IsPtrFreed(). The function
is now way more efficient, it became a simple comparison on integers,
rather than a short loop. It detects also uninitialized bytes and
"forbidden bytes" filled by debug hooks on memory allocators.

Add unit tests on _PyObject_IsFreed().

(cherry picked from commit 2b00db6)

https://bugs.python.org/issue36389

…H-12770)

Rename _PyMem_IsFreed() function to _PyMem_IsPtrFreed(). The function
is now way more efficient, it became a simple comparison on integers,
rather than a short loop. It detects also uninitialized bytes and
"forbidden bytes" filled by debug hooks on memory allocators.

Add unit tests on _PyObject_IsFreed().

(cherry picked from commit 2b00db6)
@vstinner
Copy link
Member Author

In master, I used a "static inline" function. To avoid any compilation issue in 3.7, I kept a regular function.

@vstinner
Copy link
Member Author

Oh, it seems like some buildbots are unhappy with my change in the master branch :-/

https://buildbot.python.org/all/#/builders/40/builds/1956

@vstinner
Copy link
Member Author

I close this PR. I will redo it once my following fix will be merged in master.

@vstinner vstinner closed this Apr 11, 2019
@vstinner vstinner deleted the freed37 branch April 11, 2019 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants