mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 22:02:27 +00:00
Fix Pyston speedups (#281)
We remove (i.e. hide behind a debug ifdef) the recursion checking methods, and the memory hooks and memory allocator methods. ASAN mode has no PYMALLOC, so we need a macro. Fix build break with des.c stack allocation.
This commit is contained in:
parent
2fe8571010
commit
57f0eed382
42 changed files with 260 additions and 63 deletions
8
third_party/python/Include/pymem.h
vendored
8
third_party/python/Include/pymem.h
vendored
|
@ -64,13 +64,15 @@ PyObject* _PyTraceMalloc_GetTraceback(
|
|||
_PyTraceMalloc_domain_t domain,
|
||||
uintptr_t ptr);
|
||||
|
||||
#ifdef USE_TRACEMALLOC
|
||||
int _PyMem_IsFreed(void *ptr, size_t size);
|
||||
|
||||
#if !IsModeDbg()
|
||||
#define _PyTraceMalloc_Track(domain, ptr, size) (-2)
|
||||
#define _PyTraceMalloc_Untrack(domain, ptr) (-2)
|
||||
#define _PyTraceMalloc_GetTraceback(domain, ptr) (&_Py_NoneStruct)
|
||||
#define _PyMem_IsFreed(ptr, size) (0)
|
||||
#endif
|
||||
|
||||
int _PyMem_IsFreed(void *ptr, size_t size);
|
||||
#endif /* !defined(Py_LIMITED_API) */
|
||||
|
||||
|
||||
|
@ -172,6 +174,7 @@ char * _PyMem_Strdup(const char *str);
|
|||
#define PyMem_Del PyMem_Free
|
||||
#define PyMem_DEL PyMem_FREE
|
||||
|
||||
#if IsModeDbg()
|
||||
#ifndef Py_LIMITED_API
|
||||
typedef enum {
|
||||
/* PyMem_RawMalloc(), PyMem_RawRealloc() and PyMem_RawFree() */
|
||||
|
@ -237,6 +240,7 @@ void PyMem_SetAllocator(PyMemAllocatorDomain domain,
|
|||
The function does nothing if Python is not compiled is debug mode. */
|
||||
void PyMem_SetupDebugHooks(void);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !Py_PYMEM_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue