| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
his involves moving tp_dict, tp_bases, and tp_mro to PyInterpreterState, in the same way we did for tp_subclasses. Those three fields are effectively const for builtin static types (unlike tp_subclasses). In theory we only need to make their values immortal, along with their contents. However, that isn't such a simple proposition. (See gh-103823.) In the meantime the simplest solution is to move the fields into the interpreter.
One alternative is to statically allocate the values, but that's its own can of worms.
|
| |
|
|
|
|
| |
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
|
|
|
| |
This makes it much cleaner to move more PyTypeObject fields to PyInterpreterState.
|
|
|
|
|
| |
Interpreter (gh-104072)
Until now, we haven't been initializing nor finalizing the per-interpreter state properly.
|
| |
|
|
|
|
| |
Co-authored-by: Jacob Bower <jbower@meta.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
|
| |
|
|
|
|
| |
(gh-104030)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The default task name is "Task-<counter>" (if no name is passed in during Task creation).
This is initialized in `Task.__init__` (C impl) using string formatting, which can be quite slow.
Actually using the task name in real world code is not very common, so this is wasted init.
Let's defer this string formatting to the first time the name is read (in `get_name` impl),
so we don't need to pay the string formatting cost if the task name is never read.
We don't change the order in which tasks are assigned numbers (if they are) --
the number is set on task creation, as a PyLong instead of a formatted string.
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
|
| |
|
| |
|
| |
|
|
|
| |
There were cases where we do unnecessary work for builtin static types. This also simplifies some work necessary for a per-interpreter GIL.
|
|
|
|
|
| |
Using `datetime.datetime.utcnow()` and `datetime.datetime.utcfromtimestamp()` will now raise a `DeprecationWarning`.
We also have removed our internal uses of these functions and documented the change.
|
|
|
|
| |
GetFileInformationByName when available (GH-103485)
|
| |
|
|
|
|
|
|
|
|
|
| |
Establish global state and port the following types to heap types:
- DictRemover_Type
- PyCArg_Type
- PyCThunk_Type
- PyCField_Type
- StructParam_Type
|
|
|
|
|
| |
Add socket options for source-specific multicast when present as C #defines.
Co-authored-by: Oleg Iarygin <dralife@yandex.ru>
|
| |
|
|
|
|
| |
(#103073)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is strictly about moving the "obmalloc" runtime state from
`_PyRuntimeState` to `PyInterpreterState`. Doing so improves isolation
between interpreters, specifically most of the memory (incl. objects)
allocated for each interpreter's use. This is important for a
per-interpreter GIL, but such isolation is valuable even without it.
FWIW, a per-interpreter obmalloc is the proverbial
canary-in-the-coalmine when it comes to the isolation of objects between
interpreters. Any object that leaks (unintentionally) to another
interpreter is highly likely to cause a crash (on debug builds at
least). That's a useful thing to know, relative to interpreter
isolation.
|
|
|
|
|
|
|
| |
(#94519)
Convert fork_exec to pre-inlined-argparser Argument Clinic
Co-authored-by: Gregory P. Smith <greg@krypto.org>
|
| |
|
|
|
|
| |
(#103713)
|
| |
|
|
|
|
|
|
|
|
|
| |
This is the implementation of PEP683
Motivation:
The PR introduces the ability to immortalize instances in CPython which bypasses reference counting. Tagging objects as immortal allows up to skip certain operations when we know that the object will be around for the entire execution of the runtime.
Note that this by itself will bring a performance regression to the runtime due to the extra reference count checks. However, this brings the ability of having truly immutable objects that are useful in other contexts such as immutable data sharing between sub-interpreters.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
This was only needed for Tk 8.4.13 and older,
but Tkinter already requires at least 8.5.12.
|
|
|
|
|
|
| |
Add two quoting styles for csv dialects.
They will help to work with certain databases in particular.
Automerge-Triggered-By: GH:merwok
|
|
|
| |
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
|
| |
|
|
|
|
|
| |
(#103378)
Migrate `SSLContext.set_ecdh_curve()` not to use deprecated OpenSSL APIs.
|
|
|
| |
Automerge-Triggered-By: GH:erlend-aasland
|
|
|
| |
Co-authored-by: Gregory P. Smith <greg@krypto.org>
|
|
|
|
|
| |
The function is like Py_AtExit() but for a single interpreter. This is a companion to the atexit module's register() function, taking a C callback instead of a Python one.
We also update the _xxinterpchannels module to use _Py_AtExit(), which is the motivating case. (This is inspired by pain points felt while working on gh-101660.)
|
|
|
| |
Using the raw allocator for any of the global state makes sense, especially as we move to a per-interpreter obmalloc state (gh-101660).
|
|
|
|
| |
functions with no args (GH-103168)
|
| |
|
|
|
|
|
|
|
| |
Fix a (correct) warning about potential uses of uninitialized memory in
_xxsubinterpreter. Unlike newly allocated PyObject structs or global
structs, stack-allocated structs are not initialised, and a few places in
the code expect the _sharedexception struct data to be either NULL or
initialised.
|
|
|
|
| |
Co-authored-by: Mohamed Koubaa <koubaa.m@gmail.com>
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
| |
Prior to https://github.com/python/cpython/pull/25300, the
make_ssl_data.py script used various tables, exposed in _ssl, to update
the error list.
After that PR, this is no longer used. Moreover, the err_names_to_codes
map isn't used at all. Clean those up. This gets them out of the way if,
in the future, OpenSSL provides an API to do what the code here is doing
directly. (https://github.com/openssl/openssl/issues/19848)
|
|
|
|
| |
(#103175)
|
|
|
|
|
| |
seperated -> separated
Automerge-Triggered-By: GH:AlexWaygood
|
|
|
| |
Signed-off-by: Brian Haley <haleyb.dev@gmail.com>
|
| |
|