Home
last modified time | relevance | path

Searched refs:Py_SIZE (Results 1 – 25 of 60) sorted by relevance

123

/external/python/cpython2/Modules/
Darraymodule.c56 Py_SIZE(self) < newsize + 16 && in array_resize()
58 Py_SIZE(self) = newsize; in array_resize()
74 _new_size = (newsize >> 4) + (Py_SIZE(self) < 8 ? 3 : 7) + newsize; in array_resize()
87 Py_SIZE(self) = newsize; in array_resize()
438 Py_SIZE(op) = size; in newarrayobject()
458 assert(i>=0 && i<Py_SIZE(ap)); in getarrayitem()
466 Py_ssize_t n = Py_SIZE(self); in ins1()
521 if (Py_SIZE(va) != Py_SIZE(wa) && (op == Py_EQ || op == Py_NE)) { in array_richcompare()
533 for (i = 0; i < Py_SIZE(va) && i < Py_SIZE(wa); i++) { in array_richcompare()
552 Py_ssize_t vs = Py_SIZE(va); in array_richcompare()
[all …]
/external/python/cpython2/Objects/
Dlongobject.c49 Py_ssize_t j = ABS(Py_SIZE(v)); in long_normalize()
55 Py_SIZE(v) = (Py_SIZE(v) < 0) ? -(i) : i; in long_normalize()
86 i = Py_SIZE(src); in _PyLong_Copy()
91 Py_SIZE(result) = Py_SIZE(src); in _PyLong_Copy()
132 Py_SIZE(v) = negative ? -ndigits : ndigits; in PyLong_FromLong()
160 Py_SIZE(v) = ndigits; in PyLong_FromUnsignedLong()
207 Py_SIZE(v) = -(Py_SIZE(v)); in PyLong_FromDouble()
277 i = Py_SIZE(v); in PyLong_AsLongAndOverflow()
375 i = Py_SIZE(v); in PyLong_AsSsize_t()
430 i = Py_SIZE(v); in PyLong_AsUnsignedLong()
[all …]
Dtupleobject.c74 Py_SIZE(op) = size; in PyTuple_New()
118 return Py_SIZE(op); in PyTuple_Size()
128 if (i < 0 || i >= Py_SIZE(op)) { in PyTuple_GetItem()
145 if (i < 0 || i >= Py_SIZE(op)) { in PyTuple_SetItem()
167 n = Py_SIZE(t); in _PyTuple_MaybeUntrack()
216 register Py_ssize_t len = Py_SIZE(op); in tupledealloc()
247 for (i = 0; i < Py_SIZE(op); i++) { in tupleprint()
256 i = Py_SIZE(op); in tupleprint()
272 n = Py_SIZE(v); in tuplerepr()
342 register Py_ssize_t len = Py_SIZE(v); in tuplehash()
[all …]
Dlistobject.c37 Py_SIZE(self) = newsize; in list_resize()
70 Py_SIZE(self) = newsize; in list_resize()
159 Py_SIZE(op) = size; in PyList_New()
173 return Py_SIZE(op); in PyList_Size()
185 if (i < 0 || i >= Py_SIZE(op)) { in PyList_GetItem()
209 if (i < 0 || i >= Py_SIZE(op)) { in PyList_SetItem()
225 Py_ssize_t i, n = Py_SIZE(self); in ins1()
307 i = Py_SIZE(op); in list_dealloc()
339 for (i = 0; i < Py_SIZE(op); i++) { in list_print()
373 if (Py_SIZE(v) == 0) { in list_repr()
[all …]
Dbytearrayobject.c31 if (Py_SIZE(arg) != 1) { in _getbytevalue()
71 return Py_SIZE(self); in bytearray_buffer_getreadbuf()
83 return Py_SIZE(self); in bytearray_buffer_getwritebuf()
90 *lenp = Py_SIZE(self); in bytearray_buffer_getsegcount()
103 return Py_SIZE(self); in bytearray_buffer_getcharbuf()
116 ret = PyBuffer_FillInfo(view, (PyObject*)obj, ptr, Py_SIZE(obj), 0, flags); in bytearray_getbuffer()
218 Py_SIZE(new) = size; in PyByteArray_FromStringAndSize()
253 if (size == Py_SIZE(self)) { in PyByteArray_Resize()
266 Py_SIZE(self) = size; in PyByteArray_Resize()
286 Py_SIZE(self) = size; in PyByteArray_Resize()
[all …]
Dstringobject.c793 return Py_SIZE(op); in PyString_Size()
878 Py_ssize_t size = Py_SIZE(op); in string_print()
901 if (memchr(op->ob_sval, '\'', Py_SIZE(op)) && in string_print()
902 !memchr(op->ob_sval, '"', Py_SIZE(op))) in string_print()
905 str_len = Py_SIZE(op); in string_print()
937 if (Py_SIZE(op) > (PY_SSIZE_T_MAX - 2)/4) { in PyString_Repr()
942 newsize = 2 + 4*Py_SIZE(op); in PyString_Repr()
956 memchr(op->ob_sval, '\'', Py_SIZE(op)) && in PyString_Repr()
957 !memchr(op->ob_sval, '"', Py_SIZE(op))) in PyString_Repr()
962 for (i = 0; i < Py_SIZE(op); i++) { in PyString_Repr()
[all …]
Dbytesobject.c1279 return Py_SIZE(op); in PyBytes_Size()
1339 Py_ssize_t i, length = Py_SIZE(op); in PyBytes_Repr()
1428 return Py_SIZE(a); in bytes_length()
1491 if (n > 0 && Py_SIZE(a) > PY_SSIZE_T_MAX / n) { in bytes_repeat()
1496 size = Py_SIZE(a) * n; in bytes_repeat()
1497 if (size == Py_SIZE(a) && PyBytes_CheckExact(a)) { in bytes_repeat()
1513 if (Py_SIZE(a) == 1 && n > 0) { in bytes_repeat()
1519 memcpy(op->ob_sval, a->ob_sval, Py_SIZE(a)); in bytes_repeat()
1520 i = Py_SIZE(a); in bytes_repeat()
1539 if (i < 0 || i >= Py_SIZE(a)) { in bytes_item()
[all …]
/external/python/cpython3/Modules/
Darraymodule.c117 if (self->ob_exports > 0 && newsize != Py_SIZE(self)) { in array_resize()
129 Py_SIZE(self) < newsize + 16 && in array_resize()
155 _new_size = (newsize >> 4) + (Py_SIZE(self) < 8 ? 3 : 7) + newsize; in array_resize()
624 assert(i>=0 && i<Py_SIZE(ap)); in getarrayitem()
632 Py_ssize_t n = Py_SIZE(self); in ins1()
685 if (Py_SIZE(va) != Py_SIZE(wa) && (op == Py_EQ || op == Py_NE)) { in array_richcompare()
698 Py_ssize_t common_length = Py_MIN(Py_SIZE(va), Py_SIZE(wa)); in array_richcompare()
722 for (i = 0; i < Py_SIZE(va) && i < Py_SIZE(wa); i++) { in array_richcompare()
742 Py_ssize_t vs = Py_SIZE(va); in array_richcompare()
743 Py_ssize_t ws = Py_SIZE(wa); in array_richcompare()
[all …]
D_collectionsmodule.c193 if (Py_SIZE(deque) == 0) { in deque_pop()
199 Py_SET_SIZE(deque, Py_SIZE(deque) - 1); in deque_pop()
203 if (Py_SIZE(deque)) { in deque_pop()
230 if (Py_SIZE(deque) == 0) { in deque_popleft()
237 Py_SET_SIZE(deque, Py_SIZE(deque) - 1); in deque_popleft()
241 if (Py_SIZE(deque)) { in deque_popleft()
274 #define NEEDS_TRIM(deque, maxlen) ((size_t)(maxlen) < (size_t)(Py_SIZE(deque)))
290 Py_SET_SIZE(deque, Py_SIZE(deque) + 1); in deque_append_internal()
327 Py_SET_SIZE(deque, Py_SIZE(deque) + 1); in deque_appendleft_internal()
406 if (Py_SIZE(deque) == 0) { in deque_extend()
[all …]
D_pickle.c441 Py_ssize_t i = Py_SIZE(self); in Pdata_dealloc()
482 Py_ssize_t i = Py_SIZE(self); in Pdata_clear()
538 if (Py_SIZE(self) <= self->fence) { in Pdata_pop()
542 Py_SET_SIZE(self, Py_SIZE(self) - 1); in Pdata_pop()
543 return self->data[Py_SIZE(self)]; in Pdata_pop()
550 if (Py_SIZE(self) == self->allocated && Pdata_grow(self) < 0) { in Pdata_push()
553 self->data[Py_SIZE(self)] = obj; in Pdata_push()
554 Py_SET_SIZE(self, Py_SIZE(self) + 1); in Pdata_push()
577 len = Py_SIZE(self) - start; in Pdata_poptuple()
594 len = Py_SIZE(self) - start; in Pdata_poplist()
[all …]
Dmathmodule.c879 if (Py_SIZE(a) == 0 || Py_SIZE(b) == 0) { in long_lcm()
2296 if (Py_SIZE(arg) <= 0) { in loghelper()
3158 if (Py_SIZE(n) < 0) { in math_perm_impl()
3163 if (Py_SIZE(k) < 0) { in math_perm_impl()
3281 if (Py_SIZE(n) < 0) { in math_comb_impl()
3286 if (Py_SIZE(k) < 0) { in math_comb_impl()
3297 if (Py_SIZE(temp) < 0) { in math_comb_impl()
/external/python/cpython3/Objects/
Dtupleobject.c79 Py_SIZE(op) = size; in tuple_alloc()
136 return Py_SIZE(op); in PyTuple_Size()
146 if (i < 0 || i >= Py_SIZE(op)) { in PyTuple_GetItem()
162 if (i < 0 || i >= Py_SIZE(op)) { in PyTuple_SetItem()
182 n = Py_SIZE(t); in _PyTuple_MaybeUntrack()
231 Py_ssize_t len = Py_SIZE(op); in tupledealloc()
263 n = Py_SIZE(v); in tuplerepr()
278 if (Py_SIZE(v) > 1) { in tuplerepr()
280 writer.min_length = 1 + 1 + (2 + 1) * (Py_SIZE(v) - 1) + 1; in tuplerepr()
362 Py_ssize_t i, len = Py_SIZE(v); in tuplehash()
[all …]
Dlongobject.c27 #define MEDIUM_VALUE(x) (assert(-1 <= Py_SIZE(x) && Py_SIZE(x) <= 1), \
28 Py_SIZE(x) < 0 ? -(sdigit)(x)->ob_digit[0] : \
29 (Py_SIZE(x) == 0 ? (sdigit)0 : \
52 if (v && Py_ABS(Py_SIZE(v)) <= 1) { in maybe_small_long()
77 Py_SET_SIZE(x, -Py_SIZE(x)); in _PyLong_Negate()
111 Py_ssize_t j = Py_ABS(Py_SIZE(v)); in long_normalize()
117 Py_SET_SIZE(v, (Py_SIZE(v) < 0) ? -(i) : i); in long_normalize()
275 i = Py_SIZE(src); in _PyLong_Copy()
286 Py_SET_SIZE(result, Py_SIZE(src)); in _PyLong_Copy()
466 Py_SET_SIZE(v, -(Py_SIZE(v))); in PyLong_FromDouble()
[all …]
Dlistobject.c66 if (newsize - Py_SIZE(self) > (Py_ssize_t)(new_allocated - newsize)) in list_resize()
190 return Py_SIZE(op); in PyList_Size()
215 if (!valid_index(i, Py_SIZE(op))) { in PyList_GetItem()
238 if (!valid_index(i, Py_SIZE(op))) { in PyList_SetItem()
252 Py_ssize_t i, n = Py_SIZE(self); in ins1()
334 i = Py_SIZE(op); in list_dealloc()
354 if (Py_SIZE(v) == 0) { in list_repr()
366 writer.min_length = 1 + 1 + (2 + 1) * (Py_SIZE(v) - 1) + 1; in list_repr()
373 for (i = 0; i < Py_SIZE(v); ++i) { in list_repr()
406 return Py_SIZE(a); in list_length()
[all …]
Dbytearrayobject.c61 (void)PyBuffer_FillInfo(view, (PyObject*)obj, ptr, Py_SIZE(obj), 0, flags); in bytearray_getbuffer()
191 if (requested_size == Py_SIZE(self)) { in PyByteArray_Resize()
235 Py_MIN((size_t)requested_size, (size_t)Py_SIZE(self))); in PyByteArray_Resize()
296 return Py_SIZE(self); in bytearray_length()
311 size = Py_SIZE(self); in bytearray_iconcat()
335 mysize = Py_SIZE(self); in bytearray_repeat()
361 mysize = Py_SIZE(self); in bytearray_irepeat()
384 if (i < 0 || i >= Py_SIZE(self)) { in bytearray_getitem()
403 if (i < 0 || i >= Py_SIZE(self)) { in bytearray_subscript()
482 Py_SIZE(self) - hi); in bytearray_setslice_linear()
[all …]
Dbytesobject.c1204 return Py_SIZE(op); in PyBytes_Size()
1264 Py_ssize_t i, length = Py_SIZE(op); in PyBytes_Repr()
1356 return Py_SIZE(a); in bytes_length()
1419 if (n > 0 && Py_SIZE(a) > PY_SSIZE_T_MAX / n) { in bytes_repeat()
1424 size = Py_SIZE(a) * n; in bytes_repeat()
1425 if (size == Py_SIZE(a) && PyBytes_CheckExact(a)) { in bytes_repeat()
1441 if (Py_SIZE(a) == 1 && n > 0) { in bytes_repeat()
1447 memcpy(op->ob_sval, a->ob_sval, Py_SIZE(a)); in bytes_repeat()
1448 i = Py_SIZE(a); in bytes_repeat()
1467 if (i < 0 || i >= Py_SIZE(a)) { in bytes_item()
[all …]
/external/python/cpython3/Python/
Dhamt.c577 return Py_SIZE(node) / 2; in hamt_node_bitmap_count()
588 clone = (PyHamtNode_Bitmap *)hamt_node_bitmap_new(Py_SIZE(node)); in hamt_node_bitmap_clone()
593 for (i = 0; i < Py_SIZE(node); i++) { in hamt_node_bitmap_clone()
609 Py_SIZE(o) - 2); in hamt_node_bitmap_clone_without()
624 assert(Py_SIZE(o) >= 0 && Py_SIZE(o) <= 32); in hamt_node_bitmap_clone_without()
625 for (i = val_idx + 1; i < (uint32_t)Py_SIZE(o); i++) { in hamt_node_bitmap_clone_without()
733 assert(val_idx < (size_t)Py_SIZE(self)); in hamt_node_bitmap_assoc()
952 assert(Py_SIZE(self) >= 0 && Py_SIZE(self) <= 32); in hamt_node_bitmap_assoc()
953 for (i = key_idx; i < (uint32_t)Py_SIZE(self); i++) { in hamt_node_bitmap_assoc()
1127 assert(val_idx < (size_t)Py_SIZE(self)); in hamt_node_bitmap_find()
[all …]
Dast_opt.c128 if (PyLong_Check(v) && PyLong_Check(w) && Py_SIZE(v) && Py_SIZE(w)) { in safe_multiply()
174 if (PyLong_Check(v) && PyLong_Check(w) && Py_SIZE(v) && Py_SIZE(w) > 0) { in safe_power()
191 if (PyLong_Check(v) && PyLong_Check(w) && Py_SIZE(v) && Py_SIZE(w)) { in safe_lshift()
/external/python/cpython3/Include/cpython/
Dbytearrayobject.h17 Py_SIZE(self) ? ((PyByteArrayObject *)(self))->ob_start : _PyByteArray_empty_string)
18 #define PyByteArray_GET_SIZE(self) (assert(PyByteArray_Check(self)), Py_SIZE(self))
Dtupleobject.h25 #define PyTuple_GET_SIZE(op) Py_SIZE(_PyTuple_CAST(op))
Dlistobject.h38 #define PyList_GET_SIZE(op) Py_SIZE(_PyList_CAST(op))
Dbytesobject.h34 #define PyBytes_GET_SIZE(op) (assert(PyBytes_Check(op)),Py_SIZE(op))
/external/python/cpython2/Include/
Dbytearrayobject.h49 Py_SIZE(self) ? ((PyByteArrayObject *)(self))->ob_bytes : _PyByteArray_empty_string)
50 #define PyByteArray_GET_SIZE(self) (assert(PyByteArray_Check(self)),Py_SIZE(self))
Dtupleobject.h51 #define PyTuple_GET_SIZE(op) Py_SIZE(op)
Dlistobject.h63 #define PyList_GET_SIZE(op) Py_SIZE(op)

123