mirror of
https://github.com/python/cpython.git
synced 2025-09-25 01:43:11 +00:00
[3.14] gh-103092: Support subinterpreters in `_zstd
` (GH-133674) (#133695)
gh-103092: Support subinterpreters in ``_zstd`` (GH-133674)
(cherry picked from commit 6f6f48d289
)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
This commit is contained in:
parent
3fcb9afb20
commit
8806d0f499
3 changed files with 5 additions and 5 deletions
|
@ -826,7 +826,7 @@ static int _zstd_exec(PyObject *module) {
|
||||||
// ZstdDecompressor
|
// ZstdDecompressor
|
||||||
if (add_type_to_module(module,
|
if (add_type_to_module(module,
|
||||||
"ZstdDecompressor",
|
"ZstdDecompressor",
|
||||||
&ZstdDecompressor_type_spec,
|
&zstddecompressor_type_spec,
|
||||||
&mod_state->ZstdDecompressor_type) < 0) {
|
&mod_state->ZstdDecompressor_type) < 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -890,9 +890,9 @@ _zstd_free(void *module)
|
||||||
|
|
||||||
static struct PyModuleDef_Slot _zstd_slots[] = {
|
static struct PyModuleDef_Slot _zstd_slots[] = {
|
||||||
{Py_mod_exec, _zstd_exec},
|
{Py_mod_exec, _zstd_exec},
|
||||||
|
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
|
||||||
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
|
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
|
||||||
|
{0, NULL},
|
||||||
{0}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct PyModuleDef _zstdmodule = {
|
struct PyModuleDef _zstdmodule = {
|
||||||
|
|
|
@ -32,7 +32,7 @@ get_zstd_state_from_type(PyTypeObject *type) {
|
||||||
|
|
||||||
extern PyType_Spec zstddict_type_spec;
|
extern PyType_Spec zstddict_type_spec;
|
||||||
extern PyType_Spec zstdcompressor_type_spec;
|
extern PyType_Spec zstdcompressor_type_spec;
|
||||||
extern PyType_Spec ZstdDecompressor_type_spec;
|
extern PyType_Spec zstddecompressor_type_spec;
|
||||||
|
|
||||||
struct _zstd_state {
|
struct _zstd_state {
|
||||||
PyObject *empty_bytes;
|
PyObject *empty_bytes;
|
||||||
|
|
|
@ -883,7 +883,7 @@ static PyType_Slot ZstdDecompressor_slots[] = {
|
||||||
{0}
|
{0}
|
||||||
};
|
};
|
||||||
|
|
||||||
PyType_Spec ZstdDecompressor_type_spec = {
|
PyType_Spec zstddecompressor_type_spec = {
|
||||||
.name = "_zstd.ZstdDecompressor",
|
.name = "_zstd.ZstdDecompressor",
|
||||||
.basicsize = sizeof(ZstdDecompressor),
|
.basicsize = sizeof(ZstdDecompressor),
|
||||||
.flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC,
|
.flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue