Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
84f31a56
Kaydet (Commit)
84f31a56
authored
Agu 01, 2013
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #10241: Clear extension module dict copies at interpreter shutdown.
Patch by Neil Schemenauer, minimally modified.
üst
a68cbfa5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
0 deletions
+33
-0
pystate.h
Include/pystate.h
+3
-0
NEWS
Misc/NEWS
+3
-0
import.c
Python/import.c
+2
-0
pystate.c
Python/pystate.c
+25
-0
No files found.
Include/pystate.h
Dosyayı görüntüle @
84f31a56
...
...
@@ -134,6 +134,9 @@ PyAPI_FUNC(int) PyState_AddModule(PyObject*, struct PyModuleDef*);
PyAPI_FUNC
(
int
)
PyState_RemoveModule
(
struct
PyModuleDef
*
);
#endif
PyAPI_FUNC
(
PyObject
*
)
PyState_FindModule
(
struct
PyModuleDef
*
);
#ifndef Py_LIMITED_API
PyAPI_FUNC
(
void
)
_PyState_ClearModules
(
void
);
#endif
PyAPI_FUNC
(
PyThreadState
*
)
PyThreadState_New
(
PyInterpreterState
*
);
PyAPI_FUNC
(
PyThreadState
*
)
_PyThreadState_Prealloc
(
PyInterpreterState
*
);
...
...
Misc/NEWS
Dosyayı görüntüle @
84f31a56
...
...
@@ -10,6 +10,9 @@ What's New in Python 3.4.0 Alpha 1?
Core and Builtins
-----------------
- Issue #10241: Clear extension module dict copies at interpreter shutdown.
Patch by Neil Schemenauer, minimally modified.
- Issue #9035: ismount now recognises volumes mounted below a drive root
on Windows. Original patch by Atsuo Ishimoto.
...
...
Python/import.c
Dosyayı görüntüle @
84f31a56
...
...
@@ -380,6 +380,8 @@ PyImport_Cleanup(void)
builtins
=
interp
->
builtins
;
interp
->
builtins
=
PyDict_New
();
Py_DECREF
(
builtins
);
/* Clear module dict copies stored in the interpreter state */
_PyState_ClearModules
();
/* Collect references */
_PyGC_CollectNoFail
();
/* Dump GC stats before it's too late, since it uses the warnings
...
...
Python/pystate.c
Dosyayı görüntüle @
84f31a56
...
...
@@ -320,6 +320,31 @@ PyState_RemoveModule(struct PyModuleDef* def)
return
PyList_SetItem
(
state
->
modules_by_index
,
index
,
Py_None
);
}
/* used by import.c:PyImport_Cleanup */
void
_PyState_ClearModules
(
void
)
{
PyInterpreterState
*
state
=
PyThreadState_GET
()
->
interp
;
if
(
state
->
modules_by_index
)
{
Py_ssize_t
i
;
for
(
i
=
0
;
i
<
PyList_GET_SIZE
(
state
->
modules_by_index
);
i
++
)
{
PyObject
*
m
=
PyList_GET_ITEM
(
state
->
modules_by_index
,
i
);
if
(
PyModule_Check
(
m
))
{
/* cleanup the saved copy of module dicts */
PyModuleDef
*
md
=
PyModule_GetDef
(
m
);
if
(
md
)
Py_CLEAR
(
md
->
m_base
.
m_copy
);
}
}
/* Setting modules_by_index to NULL could be dangerous, so we
clear the list instead. */
if
(
PyList_SetSlice
(
state
->
modules_by_index
,
0
,
PyList_GET_SIZE
(
state
->
modules_by_index
),
NULL
))
PyErr_WriteUnraisable
(
state
->
modules_by_index
);
}
}
void
PyThreadState_Clear
(
PyThreadState
*
tstate
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment