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
5960d80e
Kaydet (Commit)
5960d80e
authored
Tem 15, 2004
tarafından
Tim Peters
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
s/it's/its/, s/NULL/NULL{}/, where appropriate.
üst
eda29306
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
newtypes.tex
Doc/ext/newtypes.tex
+4
-4
No files found.
Doc/ext/newtypes.tex
Dosyayı görüntüle @
5960d80e
...
...
@@ -761,7 +761,7 @@ Noddy_init(Noddy *self, PyObject *args, PyObject *kwds)
\end
{
verbatim
}
With these changes, we can assure that the
\member
{
first
}
and
\member
{
last
}
members are never
NULL so we can remove checks for
\NULL
\member
{
last
}
members are never
\NULL
{}
so we can remove checks for
\NULL
{}
values in almost all cases. This means that most of the
\cfunction
{
Py
_
XDECREF
()
}
calls can be converted to
\cfunction
{
Py
_
DECREF
()
}
calls. The only place we can't change these calls is in the
...
...
@@ -891,15 +891,15 @@ Noddy_dealloc(Noddy* self)
\end
{
verbatim
}
Notice the use of a temporary variable in
\cfunction
{
Noddy
_
clear
()
}
.
We use the temporary variable so that we can set each member to
\NULL
before decrementing it
'
s reference count. We do this because, as was
We use the temporary variable so that we can set each member to
\NULL
{}
before decrementing its reference count. We do this because, as was
discussed earlier, if the reference count drops to zero, we might
cause code to run that calls back into the object. In addition,
because we now support garbage collection, we also have to worry about
code being run that triggers garbage collection. If garbage
collection is run, our
\member
{
tp
_
traverse
}
handler could get called.
We can't take a chance of having
\cfunction
{
Noddy
_
traverse
()
}
called
when a member's reference count has dropped to zero and it
'
s value
when a member's reference count has dropped to zero and its value
hasn't been set to
\NULL
.
Python
2
.
4
and higher provide a
\cfunction
{
Py
_
CLEAR
()
}
that automates
...
...
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