Lines Matching refs:size

71 /* Internal routine for changing the size, in terms of characters, of the
72 buffer of StringIO objects. The caller should ensure that the 'size'
75 resize_buffer(stringio *self, size_t size)
85 size = size + 1;
88 if (size > PY_SSIZE_T_MAX)
91 if (size < alloc / 2) {
92 /* Major downsize; resize down to exact size. */
93 alloc = size + 1;
95 else if (size < alloc) {
96 /* Within allocated size; quick exit */
99 else if (size <= alloc * 1.125) {
101 alloc = size + (size >> 3) + (size < 9 ? 3 : 6);
104 /* Major upsize; resize up to exact size */
105 alloc = size + 1;
122 "new buffer size too large");
305 size: Py_ssize_t(accept={int, NoneType}) = -1
308 Read at most size characters, returned as a string.
315 _io_StringIO_read_impl(stringio *self, Py_ssize_t size)
326 if (size < 0 || size > n) {
327 size = n;
328 if (size < 0)
329 size = 0;
333 if (self->state == STATE_ACCUMULATING && self->pos == 0 && size == n) {
341 self->pos += size;
342 return PyUnicode_FromKindAndData(PyUnicode_4BYTE_KIND, output, size);
377 size: Py_ssize_t(accept={int, NoneType}) = -1
386 _io_StringIO_readline_impl(stringio *self, Py_ssize_t size)
393 return _stringio_readline(self, size);
436 pos as size: Py_ssize_t(accept={int, NoneType}, c_default="self->pos") = None
439 Truncate size to pos.
447 _io_StringIO_truncate_impl(stringio *self, Py_ssize_t size)
453 if (size < 0) {
455 "Negative size value %zd", size);
459 if (size < self->string_size) {
461 if (resize_buffer(self, size) < 0)
463 self->string_size = size;
466 return PyLong_FromSsize_t(size);
537 Py_ssize_t size;
548 size = PyUnicode_GET_LENGTH(obj);
550 if (size > 0 && write_str(self, obj) < 0)
553 return PyLong_FromSsize_t(size);
724 /* Now everything is set up, resize buffer to size of initial value,