Home
last modified time | relevance | path

Searched refs:PY_SSIZE_T_MAX (Results 1 – 25 of 59) sorted by relevance

123

/external/python/cpython2/Include/
Dpymem.h74 #define PyMem_MALLOC(n) ((size_t)(n) > (size_t)PY_SSIZE_T_MAX ? NULL \
76 #define PyMem_REALLOC(p, n) ((size_t)(n) > (size_t)PY_SSIZE_T_MAX ? NULL \
93 ( ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \
96 ( ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \
106 ( (p) = ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \
109 ( (p) = ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \
Dpyport.h202 #define PY_SSIZE_T_MAX ((Py_ssize_t)(((size_t)-1)>>1)) macro
204 #define PY_SSIZE_T_MIN (-PY_SSIZE_T_MAX-1)
/external/python/cpython2/Modules/
Dstropmodule.c219 if (slen > PY_SSIZE_T_MAX - reslen || in strop_joinfields()
220 seplen > PY_SSIZE_T_MAX - reslen - seplen) { in strop_joinfields()
263 if (slen > PY_SSIZE_T_MAX - reslen || in strop_joinfields()
264 seplen > PY_SSIZE_T_MAX - reslen - seplen) { in strop_joinfields()
307 Py_ssize_t len, n, i = 0, last = PY_SSIZE_T_MAX; in strop_find()
351 Py_ssize_t i = 0, last = PY_SSIZE_T_MAX; in strop_rfind()
618 if (j > PY_SSIZE_T_MAX - incr) in strop_expandtabs()
622 if (j > PY_SSIZE_T_MAX - 1) in strop_expandtabs()
626 if (i > PY_SSIZE_T_MAX - j) in strop_expandtabs()
634 if (i > PY_SSIZE_T_MAX - j) in strop_expandtabs()
[all …]
Dsre.h23 # define SRE_MAXREPEAT ((SRE_CODE)PY_SSIZE_T_MAX)
30 # define SRE_MAXREPEAT ((SRE_CODE)PY_SSIZE_T_MAX)
Dbinascii.c144 #define BASE64_MAXBIN (PY_SSIZE_T_MAX/2 - sizeof(PyStringObject) - 3)
378 if (ascii_len > PY_SSIZE_T_MAX - 3) { in binascii_a2b_base64()
550 if (len > PY_SSIZE_T_MAX - 2) { in binascii_a2b_hqx()
630 if (len > PY_SSIZE_T_MAX / 2 - 2) { in binascii_rlecode_hqx()
694 if (len > PY_SSIZE_T_MAX / 2 - 2) { in binascii_b2a_hqx()
752 else if (in_len > PY_SSIZE_T_MAX / 2) { in binascii_rledecode_hqx()
784 if ( out_len > PY_SSIZE_T_MAX / 2) return PyErr_NoMemory(); \ in binascii_rledecode_hqx()
1055 if (arglen > PY_SSIZE_T_MAX / 2) { in binascii_hexlify()
1379 if (PY_SSIZE_T_MAX - delta < odatalen) { in binascii_b2a_qp()
D_json.c8 #define PY_SSIZE_T_MAX INT_MAX macro
218 if (PY_SSIZE_T_MAX - incr < output_size) { in ascii_escape_unicode()
223 if (PY_SSIZE_T_MAX / MAX_EXPANSION < input_chars || in ascii_escape_unicode()
224 PY_SSIZE_T_MAX - 2 < input_chars * MAX_EXPANSION) in ascii_escape_unicode()
225 max_output_size = PY_SSIZE_T_MAX; in ascii_escape_unicode()
244 if (output_size == PY_SSIZE_T_MAX) { in ascii_escape_unicode()
250 if (PY_SSIZE_T_MAX / 2 >= output_size && output_size * 2 < max_output_size) in ascii_escape_unicode()
314 if (PY_SSIZE_T_MAX - incr < output_size) { in ascii_escape_str()
319 if (PY_SSIZE_T_MAX / MIN_EXPANSION < input_chars || in ascii_escape_str()
320 PY_SSIZE_T_MAX - 2 < input_chars * MIN_EXPANSION) in ascii_escape_str()
[all …]
DcStringIO.c216 assert(IOOOBJECT(self)->pos <= PY_SSIZE_T_MAX - len); in IO_creadline()
401 if (oself->pos >= PY_SSIZE_T_MAX - len) { in O_cwrite()
410 if (newsize <= (size_t)newpos || newsize > PY_SSIZE_T_MAX) { in O_cwrite()
411 assert(newpos < PY_SSIZE_T_MAX - 1); in O_cwrite()
Darraymodule.c657 if (Py_SIZE(a) > PY_SSIZE_T_MAX - Py_SIZE(b)) { in array_concat()
686 if ((Py_SIZE(a) != 0) && (n > PY_SSIZE_T_MAX / Py_SIZE(a))) { in array_repeat()
836 if ((Py_SIZE(self) > PY_SSIZE_T_MAX - Py_SIZE(b)) || in array_do_extend()
837 ((Py_SIZE(self) + Py_SIZE(b)) > PY_SSIZE_T_MAX / self->ob_descr->itemsize)) { in array_do_extend()
886 (Py_SIZE(self) > PY_SSIZE_T_MAX / self->ob_descr->itemsize)) { in array_inplace_repeat()
897 if (size > PY_SSIZE_T_MAX / n) { in array_inplace_repeat()
1351 if (itemsize && (self->ob_size > PY_SSIZE_T_MAX / itemsize)) { in array_fromlist()
1418 if ((n > PY_SSIZE_T_MAX - Py_SIZE(self)) || in array_fromstring()
1419 ((Py_SIZE(self) + n) > PY_SSIZE_T_MAX / itemsize)) { in array_fromstring()
1447 if (self->ob_size <= PY_SSIZE_T_MAX / self->ob_descr->itemsize) { in array_tostring()
[all …]
Dmmapmodule.c450 if (new_size < 0 || PY_SSIZE_T_MAX - new_size < self->offset) { in mmap_resize_method()
594 if (PY_SSIZE_T_MAX - self->pos < dist) in mmap_seek_method()
599 if (PY_SSIZE_T_MAX - self->size < dist) in mmap_seek_method()
1186 if (st.st_size - offset > PY_SSIZE_T_MAX) { in new_mmap_object()
1387 if (size - offset > PY_SSIZE_T_MAX) { in new_mmap_object()
D_struct.c1207 if (extra > PY_SSIZE_T_MAX - size) in align()
1245 if (num >= PY_SSIZE_T_MAX / 10 && ( in prepare_s()
1246 num > PY_SSIZE_T_MAX / 10 || in prepare_s()
1247 (c - '0') > PY_SSIZE_T_MAX % 10)) in prepare_s()
1274 if (num > (PY_SSIZE_T_MAX - size) / itemsize) in prepare_s()
1280 if ((len + 1) > (PY_SSIZE_T_MAX / sizeof(formatcode))) { in prepare_s()
/external/python/cpython2/Objects/stringlib/
Dtransmogrify.h32 if (j > PY_SSIZE_T_MAX - incr) in stringlib_expandtabs()
38 if (j > PY_SSIZE_T_MAX - 1) in stringlib_expandtabs()
42 if (i > PY_SSIZE_T_MAX - j) in stringlib_expandtabs()
50 if (i > PY_SSIZE_T_MAX - j) in stringlib_expandtabs()
Dfind.h114 Py_ssize_t tmp_end = PY_SSIZE_T_MAX; in stringlib_parse_args_finds()
/external/python/cpython2/Lib/test/
Dtest_ucn.py16 from _testcapi import INT_MAX, PY_SSIZE_T_MAX, UINT_MAX
18 INT_MAX = PY_SSIZE_T_MAX = UINT_MAX = 2**64 - 1
147 @unittest.skipUnless(INT_MAX < PY_SSIZE_T_MAX, "needs UINT_MAX < SIZE_MAX")
Dtest_tcl.py16 from _testcapi import INT_MAX, PY_SSIZE_T_MAX
18 INT_MAX = PY_SSIZE_T_MAX = sys.maxsize
673 @unittest.skipUnless(INT_MAX < PY_SSIZE_T_MAX, "needs UINT_MAX < SIZE_MAX")
681 @unittest.skipUnless(INT_MAX < PY_SSIZE_T_MAX, "needs UINT_MAX < SIZE_MAX")
691 @unittest.skipUnless(INT_MAX < PY_SSIZE_T_MAX, "needs UINT_MAX < SIZE_MAX")
699 @unittest.skipUnless(INT_MAX < PY_SSIZE_T_MAX, "needs UINT_MAX < SIZE_MAX")
/external/python/cpython2/Objects/
Denumobject.c38 en->en_index = PY_SSIZE_T_MAX; in enum_new()
89 en->en_longindex = PyInt_FromSsize_t(PY_SSIZE_T_MAX); in enum_next_long()
134 if (en->en_index == PY_SSIZE_T_MAX) in enum_next()
Dbytearrayobject.c288 if (va.len > PY_SSIZE_T_MAX - vb.len) { in PyByteArray_Concat()
330 if (mysize > PY_SSIZE_T_MAX - vo.len) { in bytearray_iconcat()
359 if (count != 0 && mysize > PY_SSIZE_T_MAX / count) in bytearray_repeat()
384 if (count != 0 && mysize > PY_SSIZE_T_MAX / count) in bytearray_irepeat()
930 if (length > (PY_SSIZE_T_MAX - 14) / 4) { in bytearray_repr()
1158 Py_ssize_t start=0, end=PY_SSIZE_T_MAX; in bytearray_find_internal()
1208 Py_ssize_t start = 0, end = PY_SSIZE_T_MAX; in bytearray_count()
1221 stringlib_count(str + start, end - start, vsub.buf, vsub.len, PY_SSIZE_T_MAX) in bytearray_count()
1366 Py_ssize_t end = PY_SSIZE_T_MAX; in bytearray_startswith()
1405 Py_ssize_t end = PY_SSIZE_T_MAX; in bytearray_endswith()
[all …]
Dstringobject.c82 if (size > PY_SSIZE_T_MAX - PyStringObject_SIZE) { in PyString_FromStringAndSize()
122 if (size > PY_SSIZE_T_MAX - PyStringObject_SIZE) { in PyString_FromString()
931 if (Py_SIZE(op) > (PY_SSIZE_T_MAX - 2)/4) { in PyString_Repr()
1048 Py_SIZE(a) > PY_SSIZE_T_MAX - Py_SIZE(b)) { in string_concat()
1056 if (size > PY_SSIZE_T_MAX - PyStringObject_SIZE) { in string_concat()
1087 if (n && Py_SIZE(a) > PY_SSIZE_T_MAX / n) { in string_repeat()
1463 maxsplit = PY_SSIZE_T_MAX; in string_split()
1562 maxsplit = PY_SSIZE_T_MAX; in string_rsplit()
1650 if (sz < old_sz || sz > PY_SSIZE_T_MAX) { in string_join()
1712 Py_ssize_t start=0, end=PY_SSIZE_T_MAX; in string_find_internal()
[all …]
Dunicodeobject.c328 if (length > ((PY_SSIZE_T_MAX / sizeof(Py_UNICODE)) - 1)) { in _PyUnicode_New()
541 if (size > PY_SSIZE_T_MAX) { in PyUnicode_FromString()
1520 if (requiredsize > PY_SSIZE_T_MAX - repsize) in unicode_decode_call_errorhandler()
1523 if (requiredsize > PY_SSIZE_T_MAX - (insize - newpos)) in unicode_decode_call_errorhandler()
1527 if (outsize <= PY_SSIZE_T_MAX/2 && requiredsize < 2*outsize) in unicode_decode_call_errorhandler()
2744 if (size > PY_SSIZE_T_MAX || in PyUnicode_EncodeUTF16()
2745 size > PY_SSIZE_T_MAX - pairs - (byteorder == 0)) in PyUnicode_EncodeUTF16()
3072 if (size > (PY_SSIZE_T_MAX - 2 - 1) / expandsize) in unicodeescape_string()
3337 if (size > PY_SSIZE_T_MAX / expandsize) in PyUnicode_EncodeRawUnicodeEscape()
3717 if (requiredsize > PY_SSIZE_T_MAX - incr) in unicode_encode_ucs1()
[all …]
Dlongobject.c63 ((PY_SSIZE_T_MAX - offsetof(PyLongObject, ob_digit))/sizeof(digit))
391 if (x <= (size_t)PY_SSIZE_T_MAX) { in PyLong_AsSsize_t()
579 if (numsignificantbytes > (PY_SSIZE_T_MAX - PyLong_SHIFT) / 8) { in _PyLong_FromByteArray()
1363 if (size_a > PY_SSIZE_T_MAX / PyLong_SHIFT) { in long_to_decimal_string()
1484 if (size_a > (PY_SSIZE_T_MAX - i) / PyLong_SHIFT) { in _PyLong_Format()
2236 if (a_size >= (PY_SSIZE_T_MAX - 1) / PyLong_SHIFT + 1 && in _PyLong_Frexp()
2237 (a_size > (PY_SSIZE_T_MAX - 1) / PyLong_SHIFT + 1 || in _PyLong_Frexp()
2238 a_bits > (PY_SSIZE_T_MAX - 1) % PyLong_SHIFT + 1)) in _PyLong_Frexp()
2309 if (a_bits == PY_SSIZE_T_MAX) in _PyLong_Frexp()
3225 if (diff > PY_SSIZE_T_MAX/PyLong_SHIFT - 1) in long_true_divide()
[all …]
/external/python/cpython2/Modules/_io/
Dbytesio.c49 assert(self->pos < PY_SSIZE_T_MAX - len); in get_line()
70 if (size > PY_SSIZE_T_MAX) in resize_buffer()
421 assert(self->pos + len < PY_SSIZE_T_MAX); in bytesio_readinto()
527 if (pos > PY_SSIZE_T_MAX - self->pos) { in bytesio_seek()
535 if (pos > PY_SSIZE_T_MAX - self->string_size) { in bytesio_seek()
D_iomodule.h117 # define PY_OFF_T_MAX PY_SSIZE_T_MAX
/external/python/cpython2/Modules/_multiprocessing/
Dconnection.h148 Py_ssize_t res, maxlength = PY_SSIZE_T_MAX; in connection_recvbytes()
216 &freeme, PY_SSIZE_T_MAX); in connection_recvbytes_into()
302 &freeme, PY_SSIZE_T_MAX); in connection_recv_obj()
Dmultiprocessing.h72 # define PY_SSIZE_T_MAX INT_MAX macro
/external/python/cpython2/Python/
Dcodecs.c59 if (len > PY_SSIZE_T_MAX) { in normalizestring()
725 if (end - start > PY_SSIZE_T_MAX / (2+7+1)) { in PyCodec_XMLCharRefReplaceErrors()
726 end = start + PY_SSIZE_T_MAX / (2+7+1); in PyCodec_XMLCharRefReplaceErrors()
848 if (end - start > PY_SSIZE_T_MAX / (1+1+8)) in PyCodec_BackslashReplaceErrors()
849 end = start + PY_SSIZE_T_MAX / (1+1+8); in PyCodec_BackslashReplaceErrors()
/external/python/cpython2/Modules/cjkcodecs/
Dmultibytecodec.c173 if (orgsize > PY_SSIZE_T_MAX - incsize) { in expand_encodebuffer()
485 if (datalen > (PY_SSIZE_T_MAX - 16) / 2) { in multibytecodec_encode()
760 if (datalen > PY_SSIZE_T_MAX - ctx->pendingsize) { in encoder_encode_stateful()
828 npendings > PY_SSIZE_T_MAX - ctx->pendingsize) { in decoder_append_pending()
1051 if (size > PY_SSIZE_T_MAX - self->pendingsize) { in mbidecoder_decode()
1275 if (PyString_GET_SIZE(cres) > PY_SSIZE_T_MAX - self->pendingsize) { in mbstreamreader_iread()

123