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
53926a1c
Kaydet (Commit)
53926a1c
authored
Eki 09, 2015
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
_PyBytesWriter: rename size attribute to min_size
üst
fa7762ec
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
9 deletions
+10
-9
bytesobject.h
Include/bytesobject.h
+3
-2
bytesobject.c
Objects/bytesobject.c
+7
-7
No files found.
Include/bytesobject.h
Dosyayı görüntüle @
53926a1c
...
...
@@ -134,8 +134,9 @@ typedef struct {
/* Number of allocated size */
Py_ssize_t
allocated
;
/* Current size of the buffer (can be smaller than the allocated size) */
Py_ssize_t
size
;
/* Minimum number of allocated bytes,
incremented by _PyBytesWriter_Prepare() */
Py_ssize_t
min_size
;
/* If non-zero, overallocate the buffer (default: 0). */
int
overallocate
;
...
...
Objects/bytesobject.c
Dosyayı görüntüle @
53926a1c
...
...
@@ -3821,7 +3821,7 @@ _PyBytesWriter_Init(_PyBytesWriter *writer)
{
writer
->
buffer
=
NULL
;
writer
->
allocated
=
0
;
writer
->
size
=
0
;
writer
->
min_
size
=
0
;
writer
->
overallocate
=
0
;
writer
->
use_small_buffer
=
0
;
#ifdef Py_DEBUG
...
...
@@ -3874,7 +3874,7 @@ _PyBytesWriter_CheckConsistency(_PyBytesWriter *writer, char *str)
}
start
=
_PyBytesWriter_AsString
(
writer
);
assert
(
0
<=
writer
->
size
&&
writer
->
size
<=
writer
->
allocated
);
assert
(
0
<=
writer
->
min_size
&&
writer
->
min_
size
<=
writer
->
allocated
);
/* the last byte must always be null */
assert
(
start
[
writer
->
allocated
]
==
0
);
...
...
@@ -3897,18 +3897,18 @@ _PyBytesWriter_Prepare(_PyBytesWriter *writer, char *str, Py_ssize_t size)
return
str
;
}
if
(
writer
->
size
>
PY_SSIZE_T_MAX
-
size
)
{
if
(
writer
->
min_
size
>
PY_SSIZE_T_MAX
-
size
)
{
PyErr_NoMemory
();
_PyBytesWriter_Dealloc
(
writer
);
return
NULL
;
}
writer
->
size
+=
size
;
writer
->
min_
size
+=
size
;
allocated
=
writer
->
allocated
;
if
(
writer
->
size
<=
allocated
)
if
(
writer
->
min_
size
<=
allocated
)
return
str
;
allocated
=
writer
->
size
;
allocated
=
writer
->
min_
size
;
if
(
writer
->
overallocate
&&
allocated
<=
(
PY_SSIZE_T_MAX
-
allocated
/
OVERALLOCATE_FACTOR
))
{
/* overallocate to limit the number of realloc() */
...
...
@@ -3957,7 +3957,7 @@ char*
_PyBytesWriter_Alloc
(
_PyBytesWriter
*
writer
,
Py_ssize_t
size
)
{
/* ensure that _PyBytesWriter_Alloc() is only called once */
assert
(
writer
->
size
==
0
&&
writer
->
buffer
==
NULL
);
assert
(
writer
->
min_
size
==
0
&&
writer
->
buffer
==
NULL
);
assert
(
size
>=
0
);
writer
->
use_small_buffer
=
1
;
...
...
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