mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-07 02:10:27 +00:00
use IsModeDbg everywhere
This commit is contained in:
parent
bf0b9de55f
commit
bd92307d34
8 changed files with 7 additions and 11 deletions
2
third_party/python/Include/abstract.h
vendored
2
third_party/python/Include/abstract.h
vendored
|
@ -35,7 +35,7 @@ PyObject *_PyObject_FastCallKeywords(PyObject *func, PyObject **args,
|
||||||
PyObject *_PyObject_Call_Prepend(PyObject *func, PyObject *obj, PyObject *args,
|
PyObject *_PyObject_Call_Prepend(PyObject *func, PyObject *obj, PyObject *args,
|
||||||
PyObject *kwargs);
|
PyObject *kwargs);
|
||||||
|
|
||||||
#ifdef USE_CHECKFUNCRESULT
|
#if IsModeDbg()
|
||||||
PyObject *_Py_CheckFunctionResult(PyObject *func, PyObject *result,
|
PyObject *_Py_CheckFunctionResult(PyObject *func, PyObject *result,
|
||||||
const char *where);
|
const char *where);
|
||||||
#else
|
#else
|
||||||
|
|
2
third_party/python/Include/ceval.h
vendored
2
third_party/python/Include/ceval.h
vendored
|
@ -77,7 +77,7 @@ int Py_MakePendingCalls(void);
|
||||||
void Py_SetRecursionLimit(int);
|
void Py_SetRecursionLimit(int);
|
||||||
int Py_GetRecursionLimit(void);
|
int Py_GetRecursionLimit(void);
|
||||||
|
|
||||||
#ifdef USE_RECURSIVECHECK
|
#if IsModeDbg()
|
||||||
#define Py_EnterRecursiveCall(where) \
|
#define Py_EnterRecursiveCall(where) \
|
||||||
(_Py_MakeRecCheck(PyThreadState_GET()->recursion_depth) && \
|
(_Py_MakeRecCheck(PyThreadState_GET()->recursion_depth) && \
|
||||||
_Py_CheckRecursiveCall(where))
|
_Py_CheckRecursiveCall(where))
|
||||||
|
|
2
third_party/python/Include/pyerrors.h
vendored
2
third_party/python/Include/pyerrors.h
vendored
|
@ -316,7 +316,7 @@ void PyErr_BadInternalCall(void);
|
||||||
void _PyErr_BadInternalCall(const char *filename, int lineno);
|
void _PyErr_BadInternalCall(const char *filename, int lineno);
|
||||||
/* Mask the old API with a call to the new API for code compiled under
|
/* Mask the old API with a call to the new API for code compiled under
|
||||||
Python 2.0: */
|
Python 2.0: */
|
||||||
#ifdef USE_BADINTERNALCALL
|
#if IsModeDbg()
|
||||||
#define PyErr_BadInternalCall() _PyErr_BadInternalCall(__FILE__, __LINE__)
|
#define PyErr_BadInternalCall() _PyErr_BadInternalCall(__FILE__, __LINE__)
|
||||||
#else
|
#else
|
||||||
#define PyErr_BadInternalCall()
|
#define PyErr_BadInternalCall()
|
||||||
|
|
2
third_party/python/Include/pymem.h
vendored
2
third_party/python/Include/pymem.h
vendored
|
@ -66,7 +66,7 @@ PyObject* _PyTraceMalloc_GetTraceback(
|
||||||
|
|
||||||
int _PyMem_IsFreed(void *ptr, size_t size);
|
int _PyMem_IsFreed(void *ptr, size_t size);
|
||||||
|
|
||||||
#ifndef USE_TRACEMALLOC
|
#if !IsModeDbg()
|
||||||
#define _PyTraceMalloc_Track(domain, ptr, size) (-2)
|
#define _PyTraceMalloc_Track(domain, ptr, size) (-2)
|
||||||
#define _PyTraceMalloc_Untrack(domain, ptr) (-2)
|
#define _PyTraceMalloc_Untrack(domain, ptr) (-2)
|
||||||
#define _PyTraceMalloc_GetTraceback(domain, ptr) (&_Py_NoneStruct)
|
#define _PyTraceMalloc_GetTraceback(domain, ptr) (&_Py_NoneStruct)
|
||||||
|
|
2
third_party/python/Modules/_tracemalloc.c
vendored
2
third_party/python/Modules/_tracemalloc.c
vendored
|
@ -41,7 +41,7 @@ PYTHON_PROVIDE("_tracemalloc.is_tracing");
|
||||||
PYTHON_PROVIDE("_tracemalloc.start");
|
PYTHON_PROVIDE("_tracemalloc.start");
|
||||||
PYTHON_PROVIDE("_tracemalloc.stop");
|
PYTHON_PROVIDE("_tracemalloc.stop");
|
||||||
|
|
||||||
#ifdef USETRACEMALLOC
|
#if IsModeDbg()
|
||||||
/* Trace memory blocks allocated by PyMem_RawMalloc() */
|
/* Trace memory blocks allocated by PyMem_RawMalloc() */
|
||||||
#define TRACE_RAW_MALLOC
|
#define TRACE_RAW_MALLOC
|
||||||
|
|
||||||
|
|
2
third_party/python/Objects/obmalloc.c
vendored
2
third_party/python/Objects/obmalloc.c
vendored
|
@ -2291,7 +2291,7 @@ _PyObject_DebugDumpAddress(const void *p)
|
||||||
fputc('\n', stderr);
|
fputc('\n', stderr);
|
||||||
|
|
||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
#ifdef USE_TRACEMALLOC
|
#if IsModeDbg()
|
||||||
PYTHON_YOINK("_tracemalloc");
|
PYTHON_YOINK("_tracemalloc");
|
||||||
_PyMem_DumpTraceback(fileno(stderr), p);
|
_PyMem_DumpTraceback(fileno(stderr), p);
|
||||||
#endif
|
#endif
|
||||||
|
|
2
third_party/python/Python/pylifecycle.c
vendored
2
third_party/python/Python/pylifecycle.c
vendored
|
@ -274,7 +274,7 @@ _Py_InitializeEx_Private(int install_sigs, int install_importlib)
|
||||||
if (install_sigs)
|
if (install_sigs)
|
||||||
_Py_InitSigs(); /* Signal handling stuff, including initintr() */
|
_Py_InitSigs(); /* Signal handling stuff, including initintr() */
|
||||||
|
|
||||||
#ifdef USE_TRACEMALLOC
|
#if IsModeDbg()
|
||||||
if (_PyTraceMalloc_Init() < 0)
|
if (_PyTraceMalloc_Init() < 0)
|
||||||
Py_FatalError("Py_Initialize: can't initialize tracemalloc");
|
Py_FatalError("Py_Initialize: can't initialize tracemalloc");
|
||||||
#endif
|
#endif
|
||||||
|
|
4
third_party/python/pyconfig.h
vendored
4
third_party/python/pyconfig.h
vendored
|
@ -574,11 +574,7 @@
|
||||||
#define HAVE_LANGINFO_H 1
|
#define HAVE_LANGINFO_H 1
|
||||||
|
|
||||||
#if IsModeDbg()
|
#if IsModeDbg()
|
||||||
#define USE_RECURSIVECHECK 1
|
|
||||||
#define USE_CHECKFUNCRESULT 1
|
|
||||||
#define USE_BADINTERNALCALL 1
|
|
||||||
#define Py_DEBUG 1
|
#define Py_DEBUG 1
|
||||||
#define USE_TRACEMALLOC 1
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* #define FAST_LOOPS 1 /\* froot loops *\/ */
|
/* #define FAST_LOOPS 1 /\* froot loops *\/ */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue