File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,6 +10,9 @@ What's New in Python 3.4.0 Alpha 1?
1010Core and Builtins
1111-----------------
1212
13+ - Issue #17469: Fix _Py_GetAllocatedBlocks() and sys.getallocatedblocks()
14+ when running on valgrind.
15+
1316- Issue #17619: Make input() check for Ctrl-C correctly on Windows.
1417
1518- Issue #17357: Add missing verbosity messages for -v/-vv that were lost during
Original file line number Diff line number Diff line change @@ -778,6 +778,8 @@ PyObject_Malloc(size_t nbytes)
778778 poolp next ;
779779 uint size ;
780780
781+ _Py_AllocatedBlocks ++ ;
782+
781783#ifdef WITH_VALGRIND
782784 if (UNLIKELY (running_on_valgrind == -1 ))
783785 running_on_valgrind = RUNNING_ON_VALGRIND ;
@@ -791,10 +793,10 @@ PyObject_Malloc(size_t nbytes)
791793 * things without checking for overflows or negatives.
792794 * As size_t is unsigned, checking for nbytes < 0 is not required.
793795 */
794- if (nbytes > PY_SSIZE_T_MAX )
796+ if (nbytes > PY_SSIZE_T_MAX ) {
797+ _Py_AllocatedBlocks -- ;
795798 return NULL ;
796-
797- _Py_AllocatedBlocks ++ ;
799+ }
798800
799801 /*
800802 * This implicitly redirects malloc(0).
You can’t perform that action at this time.
0 commit comments