cosmopolitan/third_party/python/Objects
Justine Tunney 226aaf3547 Improve memory safety
This commit makes numerous refinements to cosmopolitan memory handling.

The default stack size has been reduced from 2mb to 128kb. A new macro
is now provided so you can easily reconfigure the stack size to be any
value you want. Work around the breaking change by adding to your main:

    STATIC_STACK_SIZE(0x00200000);  // 2mb stack

If you're not sure how much stack you need, then you can use:

    STATIC_YOINK("stack_usage_logging");

After which you can `sort -nr o/$MODE/stack.log`. Based on the unit test
suite, nothing in the Cosmopolitan repository (except for Python) needs
a stack size greater than 30kb. There are also new macros for detecting
the size and address of the stack at runtime, e.g. GetStackAddr(). We
also now support sigaltstack() so if you want to see nice looking crash
reports whenever a stack overflow happens, you can put this in main():

    ShowCrashReports();

Under `make MODE=dbg` and `make MODE=asan` the unit testing framework
will now automatically print backtraces of memory allocations when
things like memory leaks happen. Bugs are now fixed in ASAN global
variable overrun detection. The memtrack and asan runtimes also handle
edge cases now. The new tools helped to identify a few memory leaks,
which are fixed by this change.

This change should fix an issue reported in #288 with ARG_MAX limits.
Fixing this doubled the performance of MKDEPS.COM and AR.COM yet again.
2021-10-13 17:27:13 -07:00
..
clinic Make whitespace changes 2021-08-13 03:20:45 -07:00
stringlib Make numerous improvements 2021-09-28 01:52:34 -07:00
abstract.c Make numerous improvements 2021-09-28 01:52:34 -07:00
accu.c Make whitespace changes 2021-08-13 03:20:45 -07:00
boolobject.c Make whitespace changes 2021-08-13 03:20:45 -07:00
bytearrayobject.c Make whitespace changes 2021-08-13 03:20:45 -07:00
bytes_methods.c Make numerous improvements 2021-09-28 01:52:34 -07:00
bytesobject.c Make fixes, improvements, and chibicc python bindings 2021-10-08 08:41:57 -07:00
capsule.c Make whitespace changes 2021-08-13 03:20:45 -07:00
cellobject.c Make whitespace changes 2021-08-13 03:20:45 -07:00
classobject.c Make whitespace changes 2021-08-13 03:20:45 -07:00
codeobject.c Make whitespace changes 2021-08-13 03:20:45 -07:00
complexobject.c Make whitespace changes 2021-08-13 03:20:45 -07:00
descrobject.c Make whitespace changes 2021-08-13 03:20:45 -07:00
dict-common.h Make numerous improvements 2021-09-28 01:52:34 -07:00
dictobject.c Make numerous improvements 2021-09-28 01:52:34 -07:00
enumobject.c Make whitespace changes 2021-08-13 03:20:45 -07:00
exceptions.c Make whitespace changes 2021-08-13 03:20:45 -07:00
fileobject.c Implement tree-shaking for Python sources 2021-09-05 01:20:03 -07:00
floatobject.c Make numerous improvements 2021-09-28 01:52:34 -07:00
frameobject.c Make numerous improvements 2021-09-28 01:52:34 -07:00
fromfd.c Implement tree-shaking for Python sources 2021-09-05 01:20:03 -07:00
funcobject.c Make whitespace changes 2021-08-13 03:20:45 -07:00
genobject.c Make whitespace changes 2021-08-13 03:20:45 -07:00
iterobject.c Make whitespace changes 2021-08-13 03:20:45 -07:00
listobject.c Make numerous improvements 2021-09-28 01:52:34 -07:00
longobject.c Productionize new APE loader and more 2021-10-02 08:27:03 -07:00
memoryobject.c Implement tree-shaking for Python sources 2021-09-05 01:20:03 -07:00
methodobject.c Make numerous improvements 2021-09-28 01:52:34 -07:00
moduleobject.c Make whitespace changes 2021-08-13 03:20:45 -07:00
namespaceobject.c Make whitespace changes 2021-08-13 03:20:45 -07:00
object.c Make numerous improvements 2021-09-28 01:52:34 -07:00
obmalloc.c Improve memory safety 2021-10-13 17:27:13 -07:00
odictobject.c Make whitespace changes 2021-08-13 03:20:45 -07:00
rangeobject.c Make whitespace changes 2021-08-13 03:20:45 -07:00
README python-3.6.zip added from Github 2021-08-09 05:39:42 -07:00
setobject.c Make whitespace changes 2021-08-13 03:20:45 -07:00
sliceobject.c Make whitespace changes 2021-08-13 03:20:45 -07:00
structseq.c Make whitespace changes 2021-08-13 03:20:45 -07:00
tupleobject.c Add error checks to Python objectifier (#281) 2021-10-02 06:17:17 -07:00
typeobject.c Make numerous improvements 2021-09-28 01:52:34 -07:00
typeslots.inc Perform build and magnum tuning 2021-08-10 10:26:13 -07:00
typeslots.py python-3.6.zip added from Github 2021-08-09 05:39:42 -07:00
unicodectype.c Make numerous improvements 2021-09-28 01:52:34 -07:00
unicodeobject-deadcode.c Make fixes, improvements, and chibicc python bindings 2021-10-08 08:41:57 -07:00
unicodeobject.c Make fixes, improvements, and chibicc python bindings 2021-10-08 08:41:57 -07:00
weakrefobject.c Make whitespace changes 2021-08-13 03:20:45 -07:00

Source files for various builtin objects