Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
768 changes: 768 additions & 0 deletions Include/internal/pycore_global_objects_fini_generated.h

Large diffs are not rendered by default.

768 changes: 768 additions & 0 deletions Include/internal/pycore_runtime_init_generated.h

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Include/internal/pycore_runtime_structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ struct _Py_cached_objects {
};

// These would be in pycore_long.h if it weren't for an include cycle.
#define _PY_NSMALLPOSINTS 257
#define _PY_NSMALLPOSINTS 1025
#define _PY_NSMALLNEGINTS 5

#include "pycore_global_strings.h" // struct _Py_global_strings
Expand Down
2 changes: 1 addition & 1 deletion Lib/inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -3397,7 +3397,7 @@ def _main():
else:
print('Line: {}'.format(lineno))

print('\n')
print()
else:
print(getsource(obj))

Expand Down
4 changes: 2 additions & 2 deletions Lib/test/test_capi/test_immortal.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ def test_immortal(self):
class TestInternalCAPI(unittest.TestCase):

def test_immortal_builtins(self):
for obj in range(-5, 256):
for obj in range(-5, 1025):
self.assertTrue(_testinternalcapi.is_static_immortal(obj))
self.assertTrue(_testinternalcapi.is_static_immortal(None))
self.assertTrue(_testinternalcapi.is_static_immortal(False))
self.assertTrue(_testinternalcapi.is_static_immortal(True))
self.assertTrue(_testinternalcapi.is_static_immortal(...))
self.assertTrue(_testinternalcapi.is_static_immortal(()))
for obj in range(300, 400):
for obj in range(1025, 1125):
self.assertFalse(_testinternalcapi.is_static_immortal(obj))
for obj in ([], {}, set()):
self.assertFalse(_testinternalcapi.is_static_immortal(obj))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Increased the number of cached small positive integers from 256 to 1024.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix compilation problems in ``_remote_debugging_module.c`` when the system
doesn't have ``process_vm_readv``. Patch by Pablo Galindo
2 changes: 1 addition & 1 deletion Modules/_remote_debugging_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ _Py_RemoteDebug_GetAsyncioDebugAddress(proc_handle_t* handle)
PyErr_SetString(PyExc_RuntimeError, "Failed to find the AsyncioDebug section in the process.");
_PyErr_ChainExceptions1(exc);
}
#elif defined(__linux__)
#elif defined(__linux__) && HAVE_PROCESS_VM_READV
// On Linux, search for asyncio debug in executable or DLL
address = search_linux_map_for_section(handle, "AsyncioDebug", "python");
if (address == 0) {
Expand Down
4 changes: 2 additions & 2 deletions Modules/_testcapi/immortal.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ test_immortal_builtins(PyObject *self, PyObject *Py_UNUSED(ignored))
static PyObject *
test_immortal_small_ints(PyObject *self, PyObject *Py_UNUSED(ignored))
{
for (int i = -5; i <= 256; i++) {
for (int i = -5; i <= 1024; i++) {
PyObject *obj = PyLong_FromLong(i);
assert(verify_immortality(obj));
int has_int_immortal_bit = ((PyLongObject *)obj)->long_value.lv_tag & IMMORTALITY_BIT_MASK;
assert(has_int_immortal_bit);
}
for (int i = 257; i <= 260; i++) {
for (int i = 1025; i <= 1030; i++) {
PyObject *obj = PyLong_FromLong(i);
assert(obj);
int has_int_immortal_bit = ((PyLongObject *)obj)->long_value.lv_tag & IMMORTALITY_BIT_MASK;
Expand Down
2 changes: 1 addition & 1 deletion Python/remote_debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ _Py_RemoteDebug_GetPyRuntimeAddress(proc_handle_t* handle)
handle->pid);
_PyErr_ChainExceptions1(exc);
}
#elif defined(__linux__)
#elif defined(__linux__) && HAVE_PROCESS_VM_READV
// On Linux, search for 'python' in executable or DLL
address = search_linux_map_for_section(handle, "PyRuntime", "python");
if (address == 0) {
Expand Down
4 changes: 2 additions & 2 deletions Tools/c-analyzer/cpython/_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,8 @@ def format_tsv_lines(lines):
_abs('Python/compile.c'): (20_000, 500),
_abs('Python/optimizer.c'): (100_000, 5_000),
_abs('Python/parking_lot.c'): (40_000, 1000),
_abs('Python/pylifecycle.c'): (500_000, 5000),
_abs('Python/pystate.c'): (500_000, 5000),
_abs('Python/pylifecycle.c'): (750_000, 5000),
_abs('Python/pystate.c'): (750_000, 5000),
_abs('Python/initconfig.c'): (50_000, 500),

# Generated files:
Expand Down
Loading