use IsModeDbg everywhere

This commit is contained in:
ahgamut 2021-10-02 02:10:29 +05:30
parent bf0b9de55f
commit bd92307d34
8 changed files with 7 additions and 11 deletions

View file

@ -35,7 +35,7 @@ PyObject *_PyObject_FastCallKeywords(PyObject *func, PyObject **args,
PyObject *_PyObject_Call_Prepend(PyObject *func, PyObject *obj, PyObject *args,
PyObject *kwargs);
#ifdef USE_CHECKFUNCRESULT
#if IsModeDbg()
PyObject *_Py_CheckFunctionResult(PyObject *func, PyObject *result,
const char *where);
#else

View file

@ -77,7 +77,7 @@ int Py_MakePendingCalls(void);
void Py_SetRecursionLimit(int);
int Py_GetRecursionLimit(void);
#ifdef USE_RECURSIVECHECK
#if IsModeDbg()
#define Py_EnterRecursiveCall(where) \
(_Py_MakeRecCheck(PyThreadState_GET()->recursion_depth) && \
_Py_CheckRecursiveCall(where))

View file

@ -316,7 +316,7 @@ void PyErr_BadInternalCall(void);
void _PyErr_BadInternalCall(const char *filename, int lineno);
/* Mask the old API with a call to the new API for code compiled under
Python 2.0: */
#ifdef USE_BADINTERNALCALL
#if IsModeDbg()
#define PyErr_BadInternalCall() _PyErr_BadInternalCall(__FILE__, __LINE__)
#else
#define PyErr_BadInternalCall()

View file

@ -66,7 +66,7 @@ PyObject* _PyTraceMalloc_GetTraceback(
int _PyMem_IsFreed(void *ptr, size_t size);
#ifndef USE_TRACEMALLOC
#if !IsModeDbg()
#define _PyTraceMalloc_Track(domain, ptr, size) (-2)
#define _PyTraceMalloc_Untrack(domain, ptr) (-2)
#define _PyTraceMalloc_GetTraceback(domain, ptr) (&_Py_NoneStruct)

View file

@ -41,7 +41,7 @@ PYTHON_PROVIDE("_tracemalloc.is_tracing");
PYTHON_PROVIDE("_tracemalloc.start");
PYTHON_PROVIDE("_tracemalloc.stop");
#ifdef USETRACEMALLOC
#if IsModeDbg()
/* Trace memory blocks allocated by PyMem_RawMalloc() */
#define TRACE_RAW_MALLOC

View file

@ -2291,7 +2291,7 @@ _PyObject_DebugDumpAddress(const void *p)
fputc('\n', stderr);
fflush(stderr);
#ifdef USE_TRACEMALLOC
#if IsModeDbg()
PYTHON_YOINK("_tracemalloc");
_PyMem_DumpTraceback(fileno(stderr), p);
#endif

View file

@ -274,7 +274,7 @@ _Py_InitializeEx_Private(int install_sigs, int install_importlib)
if (install_sigs)
_Py_InitSigs(); /* Signal handling stuff, including initintr() */
#ifdef USE_TRACEMALLOC
#if IsModeDbg()
if (_PyTraceMalloc_Init() < 0)
Py_FatalError("Py_Initialize: can't initialize tracemalloc");
#endif

View file

@ -574,11 +574,7 @@
#define HAVE_LANGINFO_H 1
#if IsModeDbg()
#define USE_RECURSIVECHECK 1
#define USE_CHECKFUNCRESULT 1
#define USE_BADINTERNALCALL 1
#define Py_DEBUG 1
#define USE_TRACEMALLOC 1
#endif
/* #define FAST_LOOPS 1 /\* froot loops *\/ */