summaryrefslogtreecommitdiffstats
path: root/Include
Commit message (Collapse)AuthorAgeFilesLines
* bpo-46521: Fix codeop to use a new partial-input mode of the parser (GH-31010)Pablo Galindo Salgado2022-02-082-1/+5
|
* bpo-46675: Allow object value arrays and split key dictionaries larger than ↵Mark Shannon2022-02-081-4/+22
| | | | 16 (GH-31191)
* bpo-46640: Py_NAN now uses the C99 NAN constant (GH-31134)Victor Stinner2022-02-061-21/+10
| | | | | | Building Python now requires a C99 <math.h> header file providing a NAN constant, or the __builtin_nan() built-in function. If a platform does not support Not-a-Number (NaN), the Py_NO_NAN macro can be defined in the pyconfig.h file.
* bpo-46608: exclude marshalled-frozen data if deep-freezing to save 300 KB ↵Kumar Aditya2022-02-041-0/+1
| | | | | | | | | | | | | space (GH-31074) This reduces the size of the data segment by **300 KB** of the executable because if the modules are deep-frozen then the marshalled frozen data just wastes space. This was inspired by comment by @gvanrossum in https://github.com/python/cpython/pull/29118#issuecomment-958521863. Note: There is a new option `--deepfreeze-only` in `freeze_modules.py` to change this behavior, it is on be default to save disk space. ```console # du -s ./python before 27892 ./python # du -s ./python after 27524 ./python ``` Automerge-Triggered-By: GH:ericsnowcurrently
* Merge remote-tracking branch 'upstream/main'Pablo Galindo2022-02-031-4/+2
|\
| * Pass reference to func, as well as args, when pushing frame. (GH-31100)Mark Shannon2022-02-031-4/+2
| |
* | Post 3.11.0a5Pablo Galindo2022-02-031-1/+1
| |
* | Python 3.11.0a5v3.11.0a5Pablo Galindo2022-02-031-2/+2
|/
* bpo-45459: Add Py_buffer to limited API (GH-29991)Christian Heimes2022-02-026-124/+146
| | | | | | | | | | | - [x] ``Py_buffer`` struct - [x] ``PyBuffer_*()`` API functions - [x] ``PyBUF_*`` constants - [x] ``Py_bf_getbuffer`` and ``Py_bf_releasebuffer`` type slots - [x] ``PyMemoryView_FromBuffer()`` API - [x] tests for limited API - [x] ``make regen-limited-abi`` - [x] documentation update - [ ] export ``PyPickleBuffer*()`` API ???
* bpo-46072: Add some frame stats. (GH-31060)Mark Shannon2022-02-021-0/+2
|
* bpo-45953: Preserve backward compatibility on some PyThreadState field ↵Eric Snow2022-02-011-2/+5
| | | | | names. (GH-31038) The gevent project is using the two `PyThreadState` fields I renamed in gh-30590. This PR fixes the names. See #msg412046.
* bpo-46072: Add some object layout and allocation stats (GH-31051)Mark Shannon2022-02-011-0/+12
|
* bpo-46072: Add simple stats for Python calls. (GH-30989)Mark Shannon2022-01-281-0/+8
|
* bpo-46329: Split calls into precall and call instructions. (GH-30855)Mark Shannon2022-01-283-38/+49
| | | | | | | | | | | | | | * Add PRECALL_FUNCTION opcode. * Move 'call shape' varaibles into struct. * Replace CALL_NO_KW and CALL_KW with KW_NAMES and CALL instructions. * Specialize for builtin methods taking using the METH_FASTCALL | METH_KEYWORDS protocol. * Allow kwnames for specialized calls to builtin types. * Specialize calls to tuple(arg) and str(arg).
* bpo-40170: Remove PyHeapType_GET_MEMBERS() macro (GH-30942)Victor Stinner2022-01-272-4/+4
| | | | | | | | Remove the PyHeapType_GET_MEMBERS() macro. It was exposed in the public C API by mistake, it must only be used by Python internally. Use the PyTypeObject.tp_members member instead. Rename PyHeapType_GET_MEMBERS() to _PyHeapType_GET_MEMBERS() and move it to the internal C API.
* bpo-40170: Move _Py_GetAllocatedBlocks() to pycore_pymem.h (GH-30943)Victor Stinner2022-01-272-9/+8
| | | | | Move _Py_GetAllocatedBlocks() and _PyObject_DebugMallocStats() declarations to pycore_pymem.h. These functions are related to memory allocators, not to the PyObject structure.
* bpo-46476: Simplify and fix _PyStaticCode_Dealloc (GH-30965)Christian Heimes2022-01-271-1/+1
|
* bpo-46541: Generate the global objects initializer. (gh-30941)Eric Snow2022-01-271-0/+3
| | | | | | | This change is a prerequisite for generating code for other global objects (like strings in gh-30928). (We borrowed some code from Tools/scripts/deepfreeze.py.) https://bugs.python.org/issue46541
* bpo-46476: Fix memory leak in code objects generated by deepfreeze (GH-30853)Kumar Aditya2022-01-272-0/+3
| | | Add _Py_Deepfreeze_Fini() and _PyStaticCode_Dealloc() functions.
* bpo-40170: Remove _Py_GetAllocatedBlocks() function (GH-30940)Victor Stinner2022-01-272-8/+9
| | | | Move _Py_GetAllocatedBlocks() and _PyObject_DebugMallocStats() private functions to the internal C API.
* bpo-40170: PyType_SUPPORTS_WEAKREFS() becomes a regular function (GH-30938)Victor Stinner2022-01-272-2/+7
| | | | | | | | Convert the PyType_SUPPORTS_WEAKREFS() macro to a regular function. It no longer access the PyTypeObject.tp_weaklistoffset member directly. Add _PyType_SUPPORTS_WEAKREFS() static inline functions, used internally by Python for best performance.
* bpo-46528: Simplify the VM's stack manipulations (GH-30902)Brandt Bucher2022-01-261-61/+56
|
* bpo-35134: Add Include/cpython/descrobject.h (GH-30923)Victor Stinner2022-01-262-68/+72
| | | | Move Include/descrobject.h non-limited API to a new Include/cpython/descrobject.h header file.
* bpo-43683: Streamline YIELD_VALUE and SEND (GH-30723)Mark Shannon2022-01-241-6/+7
| | | | | | | | * Split YIELD_VALUE into ASYNC_GEN_WRAP; YIELD_VALUE for async generators. * Split SEND into SEND; YIELD_VALUE. * Document new opcodes.
* bpo-46481: Implement vectorcall for weakref.ref.__call__ method. (GH-30820)Dong-hee Na2022-01-231-0/+1
|
* bpo-29882: Fix portability bug introduced in GH-30774 (#30794)Mark Dickinson2022-01-231-4/+14
|
* bpo-46417: Clear symtable identifiers at exit (GH-30809)Victor Stinner2022-01-221-0/+2
| | | | | | Add _PySymtable_Fini() function, called by finalize_interp_clear(). Update test_cmd_line.test_showrefcount() to tolerate negative reference count.
* bpo-46417: Clear Unicode static types at exit (GH-30806)Victor Stinner2022-01-221-0/+1
| | | | | | | | | | | Add _PyUnicode_FiniTypes() function, called by finalize_interp_types(). It clears these static types: * EncodingMapType * PyFieldNameIter_Type * PyFormatterIter_Type _PyStaticType_Dealloc() now does nothing if tp_subclasses is not NULL.
* bpo-46417: Factorize _PyExc_InitTypes() code (GH-30804)Victor Stinner2022-01-222-2/+2
| | | | | | | | Add 'static_exceptions' list to factorize code between _PyExc_InitTypes() and _PyBuiltins_AddExceptions(). _PyExc_InitTypes() does nothing if it's not the main interpreter. Sort exceptions in Lib/test/exception_hierarchy.txt.
* bpo-46417: Clear more static types (GH-30796)Victor Stinner2022-01-222-11/+11
| | | | | | | * Move PyContext static types into object.c static_types list. * Rename PyContextTokenMissing_Type to _PyContextTokenMissing_Type and declare it in pycore_context.h. * _PyHamtItems types are no long exported: replace PyAPI_DATA() with extern.
* bpo-29882: _Py_popcount32() doesn't need 64x64 multiply (GH-30774)Victor Stinner2022-01-211-1/+1
| | | 32x32 bits multiply is enough for _Py_popcount32().
* bpo-46417: Add _PyType_GetSubclasses() function (GH-30761)Victor Stinner2022-01-211-5/+6
| | | | | | | | | | | | | | Add a new _PyType_GetSubclasses() function to get type's subclasses. _PyType_GetSubclasses(type) returns a list which holds strong refererences to subclasses. It is safer than iterating on type->tp_subclasses which yields weak references and can be modified in the loop. _PyType_GetSubclasses(type) now holds a reference to the tp_subclasses dict while creating the list of subclasses. set_collection_flag_recursive() of _abc.c now uses _PyType_GetSubclasses().
* bpo-46417: Add _PyType_CAST() macro (GH-30760)Victor Stinner2022-01-212-1/+3
| | | | In debug mode, the macro makes sure that its argument is a type using an assertion.
* bpo-46417: Py_Finalize() clears static types (GH-30743)Victor Stinner2022-01-211-0/+1
| | | | | | | Add _PyTypes_FiniTypes() best-effort function to clear static types: don't deallocate a type if it still has subclasses. remove_subclass() now sets tp_subclasses to NULL when removing the last subclass.
* bpo-46417: _curses uses PyStructSequence_NewType() (GH-30736)Victor Stinner2022-01-212-3/+5
| | | | | | | | The _curses module now creates its ncurses_version type as a heap type using PyStructSequence_NewType(), rather than using a static type. * Move _PyStructSequence_FiniType() definition to pycore_structseq.h. * test.pythoninfo: log curses.ncurses_version.
* bpo-46417: Finalize structseq types at exit (GH-30645)Victor Stinner2022-01-216-0/+10
| | | | | | | | | | | | | | | | | | Add _PyStructSequence_FiniType() and _PyStaticType_Dealloc() functions to finalize a structseq static type in Py_Finalize(). Currrently, these functions do nothing if Python is built in release mode. Clear static types: * AsyncGenHooksType: sys.set_asyncgen_hooks() * FlagsType: sys.flags * FloatInfoType: sys.float_info * Hash_InfoType: sys.hash_info * Int_InfoType: sys.int_info * ThreadInfoType: sys.thread_info * UnraisableHookArgsType: sys.unraisablehook * VersionInfoType: sys.version * WindowsVersionType: sys.getwindowsversion()
* bpo-46409: Make generators in bytecode (GH-30633)Mark Shannon2022-01-203-16/+17
| | | | | | | | | | | | * Add RETURN_GENERATOR and JUMP_NO_INTERRUPT opcodes. * Trim frame and generator by word each. * Minor refactor of frame.c * Update test.test_sys to account for smaller frames. * Treat generator functions as normal functions when evaluating and specializing.
* Merge remote-tracking branch 'upstream/main'Pablo Galindo2022-01-149-608/+687
|\
| * bpo-45569: Change PYLONG_BITS_IN_DIGIT default to 30 (GH-30497)Mark Dickinson2022-01-141-12/+4
| |
| * bpo-45953: Statically initialize all the non-object PyInterpreterState ↵Eric Snow2022-01-142-0/+29
| | | | | | | | | | fields we can. (gh-30589) https://bugs.python.org/issue45953
| * bpo-45953: Statically initialize all the PyThreadState fields we can. (gh-30590)Eric Snow2022-01-143-13/+36
| | | | | | https://bugs.python.org/issue45953
| * bpo-46362: Ensure ntpath.abspath() uses the Windows API correctly (GH-30571)neonene2022-01-131-0/+3
| | | | | | This makes ntpath.abspath()/getpath_abspath() follow normpath(), since some WinAPIs such as PathCchSkipRoot() require backslashed paths.
| * Statically initialize _PyRuntimeState fields. (gh-30588)Eric Snow2022-01-131-0/+11
| | | | | | https://bugs.python.org/issue45953
| * bpo-46370: Move the static initializer for _PyRuntime to its own header ↵Eric Snow2022-01-134-583/+604
| | | | | | | | | | file. (gh-30587) https://bugs.python.org/issue46370
* | Post 3.11.0a4Pablo Galindo2022-01-141-1/+1
| |
* | Python 3.11.0a4v3.11.0a4Pablo Galindo2022-01-131-2/+2
|/
* bpo-46315: Add ifdef HAVE_ feature checks for WASI compatibility (GH-30507)Christian Heimes2022-01-132-2/+4
|
* bpo-45953: Statically allocate the main interpreter (and initial thread ↵Eric Snow2022-01-124-16/+76
| | | | | | | | | state). (gh-29883) Previously, the main interpreter was allocated on the heap during runtime initialization. Here we instead embed it into _PyRuntimeState, which means it is statically allocated as part of the _PyRuntime global. The same goes for the initial thread state (of each interpreter, including the main one). Consequently there are fewer allocations during runtime/interpreter init, fewer possible failures, and better memory locality. FYI, this also helps efforts to consolidate globals, which in turns helps work on subinterpreter isolation. https://bugs.python.org/issue45953
* bpo-45953: Statically allocate and initialize global bytes objects. (gh-30096)Eric Snow2022-01-113-12/+280
| | | | | The empty bytes object (b'') and the 256 one-character bytes objects were allocated at runtime init. Now we statically allocate and initialize them. https://bugs.python.org/issue45953
* bpo-46303: Move fileutils.h private functions to internal C API (GH-30484)Victor Stinner2022-01-113-159/+162
| | | | | | | | | | Move almost all private functions of Include/cpython/fileutils.h to the internal C API Include/internal/pycore_fileutils.h. Only keep _Py_fopen_obj() in Include/cpython/fileutils.h, since it's used by _testcapi which must not use the internal C API. Move EncodeLocaleEx() and DecodeLocaleEx() functions from _testcapi to _testinternalcapi, since the C API moved to the internal C API.