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
560da62f
Kaydet (Commit)
560da62f
authored
Kas 24, 2001
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Rename get_referents to get_referrers. Fixes #483815.
üst
8c1ab14a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
12 deletions
+23
-12
libgc.tex
Doc/lib/libgc.tex
+7
-0
NEWS
Misc/NEWS
+4
-0
gcmodule.c
Modules/gcmodule.c
+12
-12
No files found.
Doc/lib/libgc.tex
Dosyayı görüntüle @
560da62f
...
...
@@ -78,6 +78,13 @@ Return the current collection thresholds as a tuple of
\code
{
(
\var
{
threshold0
}
,
\var
{
threshold1
}
,
\var
{
threshold2
}
)
}
.
\end{funcdesc}
\begin{funcdesc}
{
get
_
referrers
}{
*objs
}
Return the list of objects that directly refer to any of objs. This
function will only locate those containers which support garbage
collection; extension types which do refer to other objects but do not
support garbage collection will not be found.
\versionadded
{
2.2
}
\end{funcdesc}
The following variable is provided for read-only access (you can
mutate its value but should not rebind it):
...
...
Misc/NEWS
Dosyayı görüntüle @
560da62f
...
...
@@ -8,6 +8,8 @@ Core and builtins
Extension modules
- gc.get_referents was renamed to gc.get_referrers.
Library
Tools/Demos
...
...
@@ -905,6 +907,8 @@ Library
- The `new' module now exposes the CO_xxx flags.
- The gc module offers the get_referents function.
New platforms
C API
...
...
Modules/gcmodule.c
Dosyayı görüntüle @
560da62f
...
...
@@ -648,7 +648,7 @@ gc_get_thresh(PyObject *self, PyObject *args)
}
static
int
refer
ent
svisit
(
PyObject
*
obj
,
PyObject
*
objs
)
refer
rer
svisit
(
PyObject
*
obj
,
PyObject
*
objs
)
{
if
(
PySequence_Contains
(
objs
,
obj
))
{
return
1
;
...
...
@@ -657,7 +657,7 @@ referentsvisit(PyObject* obj, PyObject *objs)
}
static
int
gc_refer
ent
s_for
(
PyObject
*
objs
,
PyGC_Head
*
list
,
PyObject
*
resultlist
)
gc_refer
rer
s_for
(
PyObject
*
objs
,
PyGC_Head
*
list
,
PyObject
*
resultlist
)
{
PyGC_Head
*
gc
;
PyObject
*
obj
;
...
...
@@ -667,7 +667,7 @@ gc_referents_for(PyObject *objs, PyGC_Head *list, PyObject *resultlist)
traverse
=
obj
->
ob_type
->
tp_traverse
;
if
(
obj
==
objs
||
obj
==
resultlist
)
continue
;
if
(
traverse
(
obj
,
(
visitproc
)
refer
ent
svisit
,
objs
))
{
if
(
traverse
(
obj
,
(
visitproc
)
refer
rer
svisit
,
objs
))
{
if
(
PyList_Append
(
resultlist
,
obj
)
<
0
)
return
0
;
/* error */
}
...
...
@@ -675,17 +675,17 @@ gc_referents_for(PyObject *objs, PyGC_Head *list, PyObject *resultlist)
return
1
;
/* no error */
}
static
char
gc_get_refer
ent
s__doc__
[]
=
"get_refer
ent
s(*objs) -> list
\n
\
static
char
gc_get_refer
rer
s__doc__
[]
=
"get_refer
rer
s(*objs) -> list
\n
\
Return the list of objects that directly refer to any of objs."
;
static
PyObject
*
gc_get_refer
ent
s
(
PyObject
*
self
,
PyObject
*
args
)
gc_get_refer
rer
s
(
PyObject
*
self
,
PyObject
*
args
)
{
PyObject
*
result
=
PyList_New
(
0
);
if
(
!
(
gc_refer
ent
s_for
(
args
,
&
_PyGC_generation0
,
result
)
&&
gc_refer
ent
s_for
(
args
,
&
generation1
,
result
)
&&
gc_refer
ent
s_for
(
args
,
&
generation2
,
result
)))
{
if
(
!
(
gc_refer
rer
s_for
(
args
,
&
_PyGC_generation0
,
result
)
&&
gc_refer
rer
s_for
(
args
,
&
generation1
,
result
)
&&
gc_refer
rer
s_for
(
args
,
&
generation2
,
result
)))
{
Py_DECREF
(
result
);
return
NULL
;
}
...
...
@@ -740,7 +740,7 @@ static char gc__doc__ [] =
"set_threshold() -- Set the collection thresholds.
\n
"
"get_threshold() -- Return the current the collection thresholds.
\n
"
"get_objects() -- Return a list of all objects tracked by the collector.
\n
"
"get_refer
ent
s() -- Return the list of objects that refer to an object.
\n
"
"get_refer
rer
s() -- Return the list of objects that refer to an object.
\n
"
;
static
PyMethodDef
GcMethods
[]
=
{
...
...
@@ -753,8 +753,8 @@ static PyMethodDef GcMethods[] = {
{
"get_threshold"
,
gc_get_thresh
,
METH_VARARGS
,
gc_get_thresh__doc__
},
{
"collect"
,
gc_collect
,
METH_VARARGS
,
gc_collect__doc__
},
{
"get_objects"
,
gc_get_objects
,
METH_VARARGS
,
gc_get_objects__doc__
},
{
"get_refer
ents"
,
gc_get_referent
s
,
METH_VARARGS
,
gc_get_refer
ent
s__doc__
},
{
"get_refer
rers"
,
gc_get_referrer
s
,
METH_VARARGS
,
gc_get_refer
rer
s__doc__
},
{
NULL
,
NULL
}
/* Sentinel */
};
...
...
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