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
7b5ce7f2
Kaydet (Commit)
7b5ce7f2
authored
Nis 09, 2003
tarafından
Jeremy Hylton
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Make Unpickler objects colletable.
Bugfix candidate.
üst
4cf6319c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
23 deletions
+65
-23
cPickle.c
Modules/cPickle.c
+65
-23
No files found.
Modules/cPickle.c
Dosyayı görüntüle @
7b5ce7f2
...
@@ -5117,7 +5117,7 @@ newUnpicklerobject(PyObject *f)
...
@@ -5117,7 +5117,7 @@ newUnpicklerobject(PyObject *f)
{
{
Unpicklerobject
*
self
;
Unpicklerobject
*
self
;
if
(
!
(
self
=
PyObject_New
(
Unpicklerobject
,
&
Unpicklertype
)))
if
(
!
(
self
=
PyObject_
GC_
New
(
Unpicklerobject
,
&
Unpicklertype
)))
return
NULL
;
return
NULL
;
self
->
file
=
NULL
;
self
->
file
=
NULL
;
...
@@ -5170,6 +5170,7 @@ newUnpicklerobject(PyObject *f)
...
@@ -5170,6 +5170,7 @@ newUnpicklerobject(PyObject *f)
goto
err
;
goto
err
;
}
}
}
}
PyObject_GC_Track
(
self
);
return
self
;
return
self
;
...
@@ -5193,6 +5194,7 @@ get_Unpickler(PyObject *self, PyObject *args)
...
@@ -5193,6 +5194,7 @@ get_Unpickler(PyObject *self, PyObject *args)
static
void
static
void
Unpickler_dealloc
(
Unpicklerobject
*
self
)
Unpickler_dealloc
(
Unpicklerobject
*
self
)
{
{
PyObject_GC_UnTrack
((
PyObject
*
)
self
);
Py_XDECREF
(
self
->
readline
);
Py_XDECREF
(
self
->
readline
);
Py_XDECREF
(
self
->
read
);
Py_XDECREF
(
self
->
read
);
Py_XDECREF
(
self
->
file
);
Py_XDECREF
(
self
->
file
);
...
@@ -5210,9 +5212,47 @@ Unpickler_dealloc(Unpicklerobject *self)
...
@@ -5210,9 +5212,47 @@ Unpickler_dealloc(Unpicklerobject *self)
free
(
self
->
buf
);
free
(
self
->
buf
);
}
}
PyObject_Del
(
self
);
PyObject_
GC_
Del
(
self
);
}
}
static
int
Unpickler_traverse
(
Unpicklerobject
*
self
,
visitproc
visit
,
void
*
arg
)
{
int
err
;
#define VISIT(SLOT) \
if (SLOT) { \
err = visit((PyObject *)(SLOT), arg); \
if (err) \
return err; \
}
VISIT
(
self
->
readline
);
VISIT
(
self
->
read
);
VISIT
(
self
->
file
);
VISIT
(
self
->
memo
);
VISIT
(
self
->
stack
);
VISIT
(
self
->
pers_func
);
VISIT
(
self
->
arg
);
VISIT
(
self
->
last_string
);
#undef VISIT
return
0
;
}
static
int
Unpickler_clear
(
Unpicklerobject
*
self
)
{
#define CLEAR(SLOT) Py_XDECREF(SLOT); SLOT = NULL
CLEAR
(
self
->
readline
);
CLEAR
(
self
->
read
);
CLEAR
(
self
->
file
);
CLEAR
(
self
->
memo
);
CLEAR
(
self
->
stack
);
CLEAR
(
self
->
pers_func
);
CLEAR
(
self
->
arg
);
CLEAR
(
self
->
last_string
);
#undef CLEAR
return
0
;
}
static
PyObject
*
static
PyObject
*
Unpickler_getattr
(
Unpicklerobject
*
self
,
char
*
name
)
Unpickler_getattr
(
Unpicklerobject
*
self
,
char
*
name
)
...
@@ -5410,27 +5450,29 @@ PyDoc_STRVAR(Unpicklertype__doc__,
...
@@ -5410,27 +5450,29 @@ PyDoc_STRVAR(Unpicklertype__doc__,
static
PyTypeObject
Unpicklertype
=
{
static
PyTypeObject
Unpicklertype
=
{
PyObject_HEAD_INIT
(
NULL
)
PyObject_HEAD_INIT
(
NULL
)
0
,
/*ob_size*/
0
,
/*ob_size*/
"cPickle.Unpickler"
,
/*tp_name*/
"cPickle.Unpickler"
,
/*tp_name*/
sizeof
(
Unpicklerobject
),
/*tp_basicsize*/
sizeof
(
Unpicklerobject
),
/*tp_basicsize*/
0
,
/*tp_itemsize*/
0
,
/* methods */
(
destructor
)
Unpickler_dealloc
,
/* tp_dealloc */
(
destructor
)
Unpickler_dealloc
,
/*tp_dealloc*/
0
,
/* tp_print */
(
printfunc
)
0
,
/*tp_print*/
(
getattrfunc
)
Unpickler_getattr
,
/* tp_getattr */
(
getattrfunc
)
Unpickler_getattr
,
/*tp_getattr*/
(
setattrfunc
)
Unpickler_setattr
,
/* tp_setattr */
(
setattrfunc
)
Unpickler_setattr
,
/*tp_setattr*/
0
,
/* tp_compare */
(
cmpfunc
)
0
,
/*tp_compare*/
0
,
/* tp_repr */
(
reprfunc
)
0
,
/*tp_repr*/
0
,
/* tp_as_number */
0
,
/*tp_as_number*/
0
,
/* tp_as_sequence */
0
,
/*tp_as_sequence*/
0
,
/* tp_as_mapping */
0
,
/*tp_as_mapping*/
0
,
/* tp_hash */
(
hashfunc
)
0
,
/*tp_hash*/
0
,
/* tp_call */
(
ternaryfunc
)
0
,
/*tp_call*/
0
,
/* tp_str */
(
reprfunc
)
0
,
/*tp_str*/
0
,
/* tp_getattro */
0
,
/* tp_setattro */
/* Space for future expansion */
0
,
/* tp_as_buffer */
0L
,
0L
,
0L
,
0L
,
Py_TPFLAGS_DEFAULT
|
Py_TPFLAGS_BASETYPE
|
Py_TPFLAGS_HAVE_GC
,
Unpicklertype__doc__
/* Documentation string */
Unpicklertype__doc__
,
/* tp_doc */
(
traverseproc
)
Unpickler_traverse
,
/* tp_traverse */
(
inquiry
)
Unpickler_clear
,
/* tp_clear */
};
};
static
struct
PyMethodDef
cPickle_methods
[]
=
{
static
struct
PyMethodDef
cPickle_methods
[]
=
{
...
...
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