mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 13:52:28 +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
4
third_party/python/repl.c
vendored
4
third_party/python/repl.c
vendored
|
@ -280,8 +280,10 @@ RunPythonModule(int argc, char **argv)
|
|||
linenoiseSetHintsCallback(TerminalHint);
|
||||
linenoiseSetFreeHintsCallback(free);
|
||||
|
||||
#if IsModeDbg()
|
||||
/* Force malloc() allocator to bootstrap Python */
|
||||
_PyMem_SetupAllocators("malloc");
|
||||
#endif
|
||||
|
||||
argv_copy = (wchar_t **)PyMem_RawMalloc(sizeof(wchar_t*) * (argc+1));
|
||||
argv_copy2 = (wchar_t **)PyMem_RawMalloc(sizeof(wchar_t*) * (argc+1));
|
||||
|
@ -324,9 +326,11 @@ RunPythonModule(int argc, char **argv)
|
|||
|
||||
res = Py_Main(argc, argv_copy);
|
||||
|
||||
#if IsModeDbg()
|
||||
/* Force again malloc() allocator to release memory blocks allocated
|
||||
before Py_Main() */
|
||||
_PyMem_SetupAllocators("malloc");
|
||||
#endif
|
||||
|
||||
for (i = 0; i < argc; i++) {
|
||||
PyMem_RawFree(argv_copy2[i]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue