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
996b6714
Kaydet (Commit)
996b6714
authored
Tem 26, 2014
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #22082: Clear interned strings in slotdefs.
üst
5b561500
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
3 deletions
+19
-3
NEWS
Misc/NEWS
+2
-0
typeobject.c
Objects/typeobject.c
+17
-3
No files found.
Misc/NEWS
Dosyayı görüntüle @
996b6714
...
...
@@ -10,6 +10,8 @@ Release date: TBA
Core and Builtins
-----------------
- Issue #22082: Clear interned strings in slotdefs.
- Upgrade Unicode database to Unicode 7.0.0.
- Issue #21897: Fix a crash with the f_locals attribute with closure
...
...
Objects/typeobject.c
Dosyayı görüntüle @
996b6714
...
...
@@ -54,6 +54,9 @@ _Py_IDENTIFIER(builtins);
static
PyObject
*
slot_tp_new
(
PyTypeObject
*
type
,
PyObject
*
args
,
PyObject
*
kwds
);
static
void
clear_slotdefs
();
/*
* finds the beginning of the docstring's introspection signature.
* if present, returns a pointer pointing to the first '('.
...
...
@@ -177,6 +180,7 @@ void
_PyType_Fini
(
void
)
{
PyType_ClearCache
();
clear_slotdefs
();
}
void
...
...
@@ -6508,15 +6512,15 @@ update_slots_callback(PyTypeObject *type, void *data)
return
0
;
}
static
int
slotdefs_initialized
=
0
;
/* Initialize the slotdefs table by adding interned string objects for the
names. */
static
void
init_slotdefs
(
void
)
{
slotdef
*
p
;
static
int
initialized
=
0
;
if
(
initialized
)
if
(
slotdefs_
initialized
)
return
;
for
(
p
=
slotdefs
;
p
->
name
;
p
++
)
{
/* Slots must be ordered by their offset in the PyHeapTypeObject. */
...
...
@@ -6525,7 +6529,17 @@ init_slotdefs(void)
if
(
!
p
->
name_strobj
)
Py_FatalError
(
"Out of memory interning slotdef names"
);
}
initialized
=
1
;
slotdefs_initialized
=
1
;
}
/* Undo init_slotdefs, releasing the interned strings. */
static
void
clear_slotdefs
()
{
slotdef
*
p
;
for
(
p
=
slotdefs
;
p
->
name
;
p
++
)
{
Py_CLEAR
(
p
->
name_strobj
);
}
slotdefs_initialized
=
0
;
}
/* Update the slots after assignment to a class (type) attribute. */
...
...
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