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
39aba4f5
Kaydet (Commit)
39aba4f5
authored
Kas 12, 2011
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use the small object allocator for small bytearrays
üst
c3dfc98f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
bytearrayobject.c
Objects/bytearrayobject.c
+5
-5
No files found.
Objects/bytearrayobject.c
Dosyayı görüntüle @
39aba4f5
...
@@ -139,7 +139,7 @@ PyByteArray_FromStringAndSize(const char *bytes, Py_ssize_t size)
...
@@ -139,7 +139,7 @@ PyByteArray_FromStringAndSize(const char *bytes, Py_ssize_t size)
}
}
else
{
else
{
alloc
=
size
+
1
;
alloc
=
size
+
1
;
new
->
ob_bytes
=
Py
Mem
_Malloc
(
alloc
);
new
->
ob_bytes
=
Py
Object
_Malloc
(
alloc
);
if
(
new
->
ob_bytes
==
NULL
)
{
if
(
new
->
ob_bytes
==
NULL
)
{
Py_DECREF
(
new
);
Py_DECREF
(
new
);
return
PyErr_NoMemory
();
return
PyErr_NoMemory
();
...
@@ -209,7 +209,7 @@ PyByteArray_Resize(PyObject *self, Py_ssize_t size)
...
@@ -209,7 +209,7 @@ PyByteArray_Resize(PyObject *self, Py_ssize_t size)
alloc
=
size
+
1
;
alloc
=
size
+
1
;
}
}
sval
=
Py
Mem
_Realloc
(((
PyByteArrayObject
*
)
self
)
->
ob_bytes
,
alloc
);
sval
=
Py
Object
_Realloc
(((
PyByteArrayObject
*
)
self
)
->
ob_bytes
,
alloc
);
if
(
sval
==
NULL
)
{
if
(
sval
==
NULL
)
{
PyErr_NoMemory
();
PyErr_NoMemory
();
return
-
1
;
return
-
1
;
...
@@ -870,7 +870,7 @@ bytearray_repr(PyByteArrayObject *self)
...
@@ -870,7 +870,7 @@ bytearray_repr(PyByteArrayObject *self)
}
}
newsize
=
15
+
length
*
4
;
newsize
=
15
+
length
*
4
;
buffer
=
Py
Mem
_Malloc
(
newsize
);
buffer
=
Py
Object
_Malloc
(
newsize
);
if
(
buffer
==
NULL
)
{
if
(
buffer
==
NULL
)
{
PyErr_NoMemory
();
PyErr_NoMemory
();
return
NULL
;
return
NULL
;
...
@@ -924,7 +924,7 @@ bytearray_repr(PyByteArrayObject *self)
...
@@ -924,7 +924,7 @@ bytearray_repr(PyByteArrayObject *self)
}
}
v
=
PyUnicode_DecodeASCII
(
buffer
,
p
-
buffer
,
NULL
);
v
=
PyUnicode_DecodeASCII
(
buffer
,
p
-
buffer
,
NULL
);
Py
Mem
_Free
(
buffer
);
Py
Object
_Free
(
buffer
);
return
v
;
return
v
;
}
}
...
@@ -1020,7 +1020,7 @@ bytearray_dealloc(PyByteArrayObject *self)
...
@@ -1020,7 +1020,7 @@ bytearray_dealloc(PyByteArrayObject *self)
PyErr_Print
();
PyErr_Print
();
}
}
if
(
self
->
ob_bytes
!=
0
)
{
if
(
self
->
ob_bytes
!=
0
)
{
Py
Mem
_Free
(
self
->
ob_bytes
);
Py
Object
_Free
(
self
->
ob_bytes
);
}
}
Py_TYPE
(
self
)
->
tp_free
((
PyObject
*
)
self
);
Py_TYPE
(
self
)
->
tp_free
((
PyObject
*
)
self
);
}
}
...
...
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