Home
last modified time | relevance | path

Searched refs:Py_SIZE (Results 1 – 25 of 64) 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/cpython3/Objects/
Dlongobject.c29 #define MEDIUM_VALUE(x) (assert(-1 <= Py_SIZE(x) && Py_SIZE(x) <= 1), \
30 Py_SIZE(x) < 0 ? -(sdigit)(x)->ob_digit[0] : \
31 (Py_SIZE(x) == 0 ? (sdigit)0 : \
71 if (v && Py_ABS(Py_SIZE(v)) <= 1) { in maybe_small_long()
94 Py_SIZE(x) = -Py_SIZE(x); in _PyLong_Negate()
128 Py_ssize_t j = Py_ABS(Py_SIZE(v)); in long_normalize()
134 Py_SIZE(v) = (Py_SIZE(v) < 0) ? -(i) : i; in long_normalize()
291 i = Py_SIZE(src); in _PyLong_Copy()
300 Py_SIZE(result) = Py_SIZE(src); in _PyLong_Copy()
335 Py_SIZE(v) = sign; in PyLong_FromLong()
[all …]
Dtupleobject.c105 Py_SIZE(op) = size; in PyTuple_New()
146 return Py_SIZE(op); in PyTuple_Size()
156 if (i < 0 || i >= Py_SIZE(op)) { in PyTuple_GetItem()
172 if (i < 0 || i >= Py_SIZE(op)) { in PyTuple_SetItem()
192 n = Py_SIZE(t); in _PyTuple_MaybeUntrack()
241 Py_ssize_t len = Py_SIZE(op); in tupledealloc()
271 n = Py_SIZE(v); in tuplerepr()
286 if (Py_SIZE(v) > 1) { in tuplerepr()
288 writer.min_length = 1 + 1 + (2 + 1) * (Py_SIZE(v) - 1) + 1; in tuplerepr()
370 Py_ssize_t i, len = Py_SIZE(v); in tuplehash()
[all …]
Dlistobject.c48 Py_SIZE(self) = newsize; in list_resize()
76 Py_SIZE(self) = newsize; in list_resize()
195 Py_SIZE(op) = size; in PyList_New()
226 return Py_SIZE(op); in PyList_Size()
251 if (!valid_index(i, Py_SIZE(op))) { in PyList_GetItem()
274 if (!valid_index(i, Py_SIZE(op))) { in PyList_SetItem()
288 Py_ssize_t i, n = Py_SIZE(self); in ins1()
370 i = Py_SIZE(op); in list_dealloc()
390 if (Py_SIZE(v) == 0) { in list_repr()
402 writer.min_length = 1 + 1 + (2 + 1) * (Py_SIZE(v) - 1) + 1; in list_repr()
[all …]
Dbytearrayobject.c63 (void)PyBuffer_FillInfo(view, (PyObject*)obj, ptr, Py_SIZE(obj), 0, flags); in bytearray_getbuffer()
152 Py_SIZE(new) = size; in PyByteArray_FromStringAndSize()
194 if (requested_size == Py_SIZE(self)) { in PyByteArray_Resize()
210 Py_SIZE(self) = size; in PyByteArray_Resize()
238 Py_MIN((size_t)requested_size, (size_t)Py_SIZE(self))); in PyByteArray_Resize()
250 Py_SIZE(self) = size; in PyByteArray_Resize()
297 return Py_SIZE(self); in bytearray_length()
312 size = Py_SIZE(self); in bytearray_iconcat()
336 mysize = Py_SIZE(self); in bytearray_repeat()
362 mysize = Py_SIZE(self); in bytearray_irepeat()
[all …]
Dbytesobject.c1275 return Py_SIZE(op); in PyBytes_Size()
1335 Py_ssize_t i, length = Py_SIZE(op); in PyBytes_Repr()
1426 return Py_SIZE(a); in bytes_length()
1489 if (n > 0 && Py_SIZE(a) > PY_SSIZE_T_MAX / n) { in bytes_repeat()
1494 size = Py_SIZE(a) * n; in bytes_repeat()
1495 if (size == Py_SIZE(a) && PyBytes_CheckExact(a)) { in bytes_repeat()
1511 if (Py_SIZE(a) == 1 && n > 0) { in bytes_repeat()
1517 memcpy(op->ob_sval, a->ob_sval, Py_SIZE(a)); in bytes_repeat()
1518 i = Py_SIZE(a); in bytes_repeat()
1537 if (i < 0 || i >= Py_SIZE(a)) { in bytes_item()
[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()
131 Py_SIZE(self) = newsize; in array_resize()
138 Py_SIZE(self) = 0; in array_resize()
155 _new_size = (newsize >> 4) + (Py_SIZE(self) < 8 ? 3 : 7) + newsize; in array_resize()
168 Py_SIZE(self) = newsize; in array_resize()
598 Py_SIZE(op) = size; in newarrayobject()
619 assert(i>=0 && i<Py_SIZE(ap)); in getarrayitem()
627 Py_ssize_t n = Py_SIZE(self); in ins1()
680 if (Py_SIZE(va) != Py_SIZE(wa) && (op == Py_EQ || op == Py_NE)) { in array_richcompare()
[all …]
D_collectionsmodule.c175 Py_SIZE(deque) = 0; in deque_new()
193 if (Py_SIZE(deque) == 0) { in deque_pop()
199 Py_SIZE(deque)--; in deque_pop()
203 if (Py_SIZE(deque)) { in deque_pop()
230 if (Py_SIZE(deque) == 0) { in deque_popleft()
237 Py_SIZE(deque)--; 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_SIZE(deque)++; in deque_append_internal()
327 Py_SIZE(deque)++; in deque_appendleft_internal()
[all …]
D_pickle.c441 Py_ssize_t i = Py_SIZE(self); in Pdata_dealloc()
464 Py_SIZE(self) = 0; in Pdata_New()
482 Py_ssize_t i = Py_SIZE(self); in Pdata_clear()
491 Py_SIZE(self) = clearto; in Pdata_clear()
538 if (Py_SIZE(self) <= self->fence) { in Pdata_pop()
542 return self->data[--Py_SIZE(self)]; in Pdata_pop()
549 if (Py_SIZE(self) == self->allocated && Pdata_grow(self) < 0) { in Pdata_push()
552 self->data[Py_SIZE(self)++] = obj; in Pdata_push()
575 len = Py_SIZE(self) - start; in Pdata_poptuple()
582 Py_SIZE(self) = start; in Pdata_poptuple()
[all …]
/external/python/cpython3/Python/
Dhamt.c554 Py_SIZE(node) = size; in hamt_node_bitmap_new()
578 return Py_SIZE(node) / 2; in hamt_node_bitmap_count()
589 clone = (PyHamtNode_Bitmap *)hamt_node_bitmap_new(Py_SIZE(node)); in hamt_node_bitmap_clone()
594 for (i = 0; i < Py_SIZE(node); i++) { in hamt_node_bitmap_clone()
610 Py_SIZE(o) - 2); in hamt_node_bitmap_clone_without()
625 assert(Py_SIZE(o) >= 0 && Py_SIZE(o) <= 32); in hamt_node_bitmap_clone_without()
626 for (i = val_idx + 1; i < (uint32_t)Py_SIZE(o); i++) { in hamt_node_bitmap_clone_without()
734 assert(val_idx < (size_t)Py_SIZE(self)); in hamt_node_bitmap_assoc()
953 assert(Py_SIZE(self) >= 0 && Py_SIZE(self) <= 32); in hamt_node_bitmap_assoc()
954 for (i = key_idx; i < (uint32_t)Py_SIZE(self); i++) { in hamt_node_bitmap_assoc()
[all …]
Dast_opt.c127 if (PyLong_Check(v) && PyLong_Check(w) && Py_SIZE(v) && Py_SIZE(w)) { in safe_multiply()
173 if (PyLong_Check(v) && PyLong_Check(w) && Py_SIZE(v) && Py_SIZE(w) > 0) { in safe_power()
190 if (PyLong_Check(v) && PyLong_Check(w) && Py_SIZE(v) && Py_SIZE(w)) { in safe_lshift()
/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)
Dstringobject.h92 #define PyString_GET_SIZE(op) Py_SIZE(op)
/external/python/cpython3/Include/
Dbytearrayobject.h53 Py_SIZE(self) ? ((PyByteArrayObject *)(self))->ob_start : _PyByteArray_empty_string)
54 #define PyByteArray_GET_SIZE(self) (assert(PyByteArray_Check(self)), Py_SIZE(self))
Dlistobject.h74 #define PyList_GET_SIZE(op) (assert(PyList_Check(op)),Py_SIZE(op))
Dobjimpl.h155 Py_SIZE(op) = size; in _PyObject_INIT_VAR()
/external/python/cpython3/Include/cpython/
Dtupleobject.h25 #define PyTuple_GET_SIZE(op) Py_SIZE(_PyTuple_CAST(op))

123