bpo-35368: Add assertions in pymalloc to check GIL by vstinner · Pull Request #10866 · python/cpython
/* pymalloc is protected by the GIL */ assert(PyGILState_Check());
#ifdef WITH_VALGRIND if (UNLIKELY(running_on_valgrind == -1)) { running_on_valgrind = RUNNING_ON_VALGRIND;
assert(p != NULL);
/* pymalloc is protected by the GIL */ assert(PyGILState_Check());
#ifdef WITH_VALGRIND if (UNLIKELY(running_on_valgrind > 0)) { return 0;
assert(p != NULL);
/* pymalloc is protected by the GIL */ assert(PyGILState_Check());
#ifdef WITH_VALGRIND /* Treat running_on_valgrind == -1 the same as 0 */ if (UNLIKELY(running_on_valgrind > 0)) {
static void *