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
d1327502
Kaydet (Commit)
d1327502
authored
Ara 02, 2001
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Patch 487906: update inline docs.
üst
c7b78381
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
13 deletions
+21
-13
stringobject.c
Objects/stringobject.c
+21
-13
No files found.
Objects/stringobject.c
Dosyayı görüntüle @
d1327502
...
@@ -19,19 +19,27 @@ static PyStringObject *nullstring;
...
@@ -19,19 +19,27 @@ static PyStringObject *nullstring;
#endif
#endif
/*
/*
Newsizedstringobject() and newstringobject() try in certain cases
PyString_FromStringAndSize() and PyString_FromString() try in certain cases
to share string objects. When the size of the string is zero,
to share string objects. When the size of the string is zero, these
these routines always return a pointer to the same string object;
routines always return a pointer to the same string object; when the size
when the size is one, they return a pointer to an already existing
is one, they return a pointer to an already existing object if the contents
object if the contents of the string is known. For
of the string is known. For PyString_FromString() this is always the case,
newstringobject() this is always the case, for
for PyString_FromStringAndSize() this is the case when the first argument
newsizedstringobject() this is the case when the first argument in
in not NULL.
not NULL.
A common practice to allocate a string and then fill it in or
A common practice of allocating a string and then filling it in or changing
change it must be done carefully. It is only allowed to change the
it must be done carefully. It is only allowed to change the contents of
contents of the string if the obect was gotten from
the string if the object was gotten from PyString_FromStringAndSize() with
newsizedstringobject() with a NULL first argument, because in the
a NULL first argument, because in the future these routines may try to do
future these routines may try to do even more sharing of objects.
even more sharing of objects.
The parameter `size' denotes number of characters to allocate, not counting
the null terminating character. If the `str' argument is not NULL, then it
must point to a null-terminated string of length `size'.
The member `op->ob_size' denotes the number of bytes of data in the string,
not counting the null terminating character, and is therefore equal to the
`size' parameter.
*/
*/
PyObject
*
PyObject
*
PyString_FromStringAndSize
(
const
char
*
str
,
int
size
)
PyString_FromStringAndSize
(
const
char
*
str
,
int
size
)
...
...
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