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
7b216c52
Kaydet (Commit)
7b216c52
authored
Mar 04, 2006
tarafından
Neal Norwitz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Make PyGC_Collect() use Py_ssize_t.
üst
84632ee3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
objimpl.h
Include/objimpl.h
+1
-1
gcmodule.c
Modules/gcmodule.c
+11
-11
No files found.
Include/objimpl.h
Dosyayı görüntüle @
7b216c52
...
...
@@ -229,7 +229,7 @@ PyAPI_FUNC(PyVarObject *) _PyObject_NewVar(PyTypeObject *, Py_ssize_t);
*/
/* C equivalent of gc.collect(). */
PyAPI_FUNC
(
long
)
PyGC_Collect
(
void
);
PyAPI_FUNC
(
Py_ssize_t
)
PyGC_Collect
(
void
);
/* Test if a type has a GC head */
#define PyType_IS_GC(t) PyType_HasFeature((t), Py_TPFLAGS_HAVE_GC)
...
...
Modules/gcmodule.c
Dosyayı görüntüle @
7b216c52
...
...
@@ -196,11 +196,11 @@ gc_list_merge(PyGC_Head *from, PyGC_Head *to)
gc_list_init
(
from
);
}
static
long
static
Py_ssize_t
gc_list_size
(
PyGC_Head
*
list
)
{
PyGC_Head
*
gc
;
long
n
=
0
;
Py_ssize_t
n
=
0
;
for
(
gc
=
list
->
gc
.
gc_next
;
gc
!=
list
;
gc
=
gc
->
gc
.
gc_next
)
{
n
++
;
}
...
...
@@ -719,12 +719,12 @@ delete_garbage(PyGC_Head *collectable, PyGC_Head *old)
/* This is the main function. Read this to understand how the
* collection process works. */
static
long
static
Py_ssize_t
collect
(
int
generation
)
{
int
i
;
long
m
=
0
;
/* # objects collected */
long
n
=
0
;
/* # unreachable objects that couldn't be collected */
Py_ssize_t
m
=
0
;
/* # objects collected */
Py_ssize_t
n
=
0
;
/* # unreachable objects that couldn't be collected */
PyGC_Head
*
young
;
/* the generation we are examining */
PyGC_Head
*
old
;
/* next older generation */
PyGC_Head
unreachable
;
/* non-problematic unreachable trash */
...
...
@@ -856,11 +856,11 @@ collect(int generation)
return
n
+
m
;
}
static
long
static
Py_ssize_t
collect_generations
(
void
)
{
int
i
;
long
n
=
0
;
Py_ssize_t
n
=
0
;
/* Find the oldest generation (higest numbered) where the count
* exceeds the threshold. Objects in the that generation and
...
...
@@ -919,7 +919,7 @@ PyDoc_STRVAR(gc_collect__doc__,
static
PyObject
*
gc_collect
(
PyObject
*
self
,
PyObject
*
noargs
)
{
long
n
;
Py_ssize_t
n
;
if
(
collecting
)
n
=
0
;
/* already collecting, don't do anything */
...
...
@@ -929,7 +929,7 @@ gc_collect(PyObject *self, PyObject *noargs)
collecting
=
0
;
}
return
Py
_BuildValue
(
"l"
,
n
);
return
Py
Int_FromSsize_t
(
n
);
}
PyDoc_STRVAR
(
gc_set_debug__doc__
,
...
...
@@ -1181,10 +1181,10 @@ initgc(void)
}
/* API to invoke gc.collect() from C */
long
Py_ssize_t
PyGC_Collect
(
void
)
{
long
n
;
Py_ssize_t
n
;
if
(
collecting
)
n
=
0
;
/* already collecting, don't do anything */
...
...
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