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
dfde2151
Kaydet (Commit)
dfde2151
authored
Tem 11, 2013
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix reference leaks introduced by the patch for issue #5308.
üst
cca40ffa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
12 deletions
+11
-12
marshal.c
Python/marshal.c
+11
-12
No files found.
Python/marshal.c
Dosyayı görüntüle @
dfde2151
...
...
@@ -95,7 +95,7 @@ w_more(int c, WFILE *p)
}
static
void
w_string
(
char
*
s
,
Py_ssize_t
n
,
WFILE
*
p
)
w_string
(
c
onst
c
har
*
s
,
Py_ssize_t
n
,
WFILE
*
p
)
{
if
(
p
->
fp
!=
NULL
)
{
fwrite
(
s
,
1
,
n
,
p
->
fp
);
...
...
@@ -139,6 +139,13 @@ w_long(long x, WFILE *p)
# define W_SIZE w_long
#endif
static
void
w_pstring
(
const
char
*
s
,
Py_ssize_t
n
,
WFILE
*
p
)
{
W_SIZE
(
n
,
p
);
w_string
(
s
,
n
,
p
);
}
/* We assume that Python longs are stored internally in base some power of
2**15; for the sake of portability we'll always read and write them in base
exactly 2**15. */
...
...
@@ -313,9 +320,7 @@ w_object(PyObject *v, WFILE *p)
}
else
if
(
PyBytes_CheckExact
(
v
))
{
w_byte
(
TYPE_STRING
,
p
);
n
=
PyBytes_GET_SIZE
(
v
);
W_SIZE
(
n
,
p
);
w_string
(
PyBytes_AS_STRING
(
v
),
n
,
p
);
w_pstring
(
PyBytes_AS_STRING
(
v
),
PyBytes_GET_SIZE
(
v
),
p
);
}
else
if
(
PyUnicode_CheckExact
(
v
))
{
PyObject
*
utf8
;
...
...
@@ -326,9 +331,7 @@ w_object(PyObject *v, WFILE *p)
return
;
}
w_byte
(
TYPE_UNICODE
,
p
);
n
=
PyBytes_GET_SIZE
(
utf8
);
W_SIZE
(
n
,
p
);
w_string
(
PyBytes_AS_STRING
(
utf8
),
n
,
p
);
w_pstring
(
PyBytes_AS_STRING
(
utf8
),
PyBytes_GET_SIZE
(
utf8
),
p
);
Py_DECREF
(
utf8
);
}
else
if
(
PyTuple_CheckExact
(
v
))
{
...
...
@@ -411,7 +414,6 @@ w_object(PyObject *v, WFILE *p)
}
else
if
(
PyObject_CheckBuffer
(
v
))
{
/* Write unknown buffer-style objects as a string */
char
*
s
;
Py_buffer
view
;
if
(
PyObject_GetBuffer
(
v
,
&
view
,
PyBUF_SIMPLE
)
!=
0
)
{
w_byte
(
TYPE_UNKNOWN
,
p
);
...
...
@@ -420,10 +422,7 @@ w_object(PyObject *v, WFILE *p)
return
;
}
w_byte
(
TYPE_STRING
,
p
);
n
=
view
.
len
;
s
=
view
.
buf
;
W_SIZE
(
n
,
p
);
w_string
(
s
,
n
,
p
);
w_pstring
(
view
.
buf
,
view
.
len
,
p
);
PyBuffer_Release
(
&
view
);
}
else
{
...
...
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