Home
last modified time | relevance | path

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

12

/third_party/python/Modules/
Darraymodule.c129 if (self->ob_exports > 0 && newsize != Py_SIZE(self)) { in array_resize()
141 Py_SIZE(self) < newsize + 16 && in array_resize()
167 _new_size = (newsize >> 4) + (Py_SIZE(self) < 8 ? 3 : 7) + newsize; in array_resize()
628 assert(i>=0 && i<Py_SIZE(ap)); in getarrayitem()
636 Py_ssize_t n = Py_SIZE(self); in ins1()
701 if (Py_SIZE(va) != Py_SIZE(wa) && (op == Py_EQ || op == Py_NE)) { in array_richcompare()
714 Py_ssize_t common_length = Py_MIN(Py_SIZE(va), Py_SIZE(wa)); in array_richcompare()
738 for (i = 0; i < Py_SIZE(va) && i < Py_SIZE(wa); i++) { in array_richcompare()
758 Py_ssize_t vs = Py_SIZE(va); in array_richcompare()
759 Py_ssize_t ws = Py_SIZE(wa); in array_richcompare()
[all …]
D_collectionsmodule.c194 if (Py_SIZE(deque) == 0) { in deque_pop()
200 Py_SET_SIZE(deque, Py_SIZE(deque) - 1); in deque_pop()
204 if (Py_SIZE(deque)) { in deque_pop()
231 if (Py_SIZE(deque) == 0) { in deque_popleft()
238 Py_SET_SIZE(deque, Py_SIZE(deque) - 1); in deque_popleft()
242 if (Py_SIZE(deque)) { in deque_popleft()
275 #define NEEDS_TRIM(deque, maxlen) ((size_t)(maxlen) < (size_t)(Py_SIZE(deque)))
291 Py_SET_SIZE(deque, Py_SIZE(deque) + 1); in deque_append_internal()
328 Py_SET_SIZE(deque, Py_SIZE(deque) + 1); in deque_appendleft_internal()
407 if (Py_SIZE(deque) == 0) { in deque_extend()
[all …]
D_pickle.c442 Py_ssize_t i = Py_SIZE(self); in Pdata_dealloc()
483 Py_ssize_t i = Py_SIZE(self); in Pdata_clear()
539 if (Py_SIZE(self) <= self->fence) { in Pdata_pop()
543 Py_SET_SIZE(self, Py_SIZE(self) - 1); in Pdata_pop()
544 return self->data[Py_SIZE(self)]; in Pdata_pop()
551 if (Py_SIZE(self) == self->allocated && Pdata_grow(self) < 0) { in Pdata_push()
554 self->data[Py_SIZE(self)] = obj; in Pdata_push()
555 Py_SET_SIZE(self, Py_SIZE(self) + 1); in Pdata_push()
578 len = Py_SIZE(self) - start; in Pdata_poptuple()
595 len = Py_SIZE(self) - start; in Pdata_poplist()
[all …]
Dmathmodule.c883 if (Py_SIZE(a) == 0 || Py_SIZE(b) == 0) { in long_lcm()
2278 if (Py_SIZE(arg) <= 0) { in loghelper()
3256 if (Py_SIZE(n) < 0) { in math_perm_impl()
3261 if (Py_SIZE(k) < 0) { in math_perm_impl()
3366 if (Py_SIZE(n) < 0) { in math_comb_impl()
3371 if (Py_SIZE(k) < 0) { in math_comb_impl()
3382 if (Py_SIZE(temp) < 0) { in math_comb_impl()
/third_party/python/Objects/
Dlongobject.c31 #define MEDIUM_VALUE(x) (assert(-1 <= Py_SIZE(x) && Py_SIZE(x) <= 1), \
32 Py_SIZE(x) < 0 ? -(sdigit)(x)->ob_digit[0] : \
33 (Py_SIZE(x) == 0 ? (sdigit)0 : \
53 if (v && Py_ABS(Py_SIZE(v)) <= 1) { in maybe_small_long()
72 Py_SET_SIZE(x, -Py_SIZE(x)); in _PyLong_Negate()
106 Py_ssize_t j = Py_ABS(Py_SIZE(v)); in long_normalize()
112 Py_SET_SIZE(v, (Py_SIZE(v) < 0) ? -(i) : i); in long_normalize()
154 i = Py_SIZE(src); in _PyLong_Copy()
165 Py_SET_SIZE(result, Py_SIZE(src)); in _PyLong_Copy()
345 Py_SET_SIZE(v, -(Py_SIZE(v))); in PyLong_FromDouble()
[all …]
Dtupleobject.c176 return Py_SIZE(op); in PyTuple_Size()
186 if (i < 0 || i >= Py_SIZE(op)) { in PyTuple_GetItem()
202 if (i < 0 || i >= Py_SIZE(op)) { in PyTuple_SetItem()
222 n = Py_SIZE(t); in _PyTuple_MaybeUntrack()
270 Py_ssize_t len = Py_SIZE(op); in tupledealloc()
309 n = Py_SIZE(v); in tuplerepr()
324 if (Py_SIZE(v) > 1) { in tuplerepr()
326 writer.min_length = 1 + 1 + (2 + 1) * (Py_SIZE(v) - 1) + 1; in tuplerepr()
408 Py_ssize_t i, len = Py_SIZE(v); in tuplehash()
434 return Py_SIZE(a); in tuplelength()
[all …]
Dlistobject.c75 if (newsize - Py_SIZE(self) > (Py_ssize_t)(new_allocated - newsize)) in list_resize()
206 return Py_SIZE(op); in PyList_Size()
231 if (!valid_index(i, Py_SIZE(op))) { in PyList_GetItem()
254 if (!valid_index(i, Py_SIZE(op))) { in PyList_SetItem()
268 Py_ssize_t i, n = Py_SIZE(self); in ins1()
341 i = Py_SIZE(op); in list_dealloc()
368 if (Py_SIZE(v) == 0) { in list_repr()
380 writer.min_length = 1 + 1 + (2 + 1) * (Py_SIZE(v) - 1) + 1; in list_repr()
387 for (i = 0; i < Py_SIZE(v); ++i) { in list_repr()
420 return Py_SIZE(a); in list_length()
[all …]
Dbytearrayobject.c53 (void)PyBuffer_FillInfo(view, (PyObject*)obj, ptr, Py_SIZE(obj), 0, flags); in bytearray_getbuffer()
183 if (requested_size == Py_SIZE(self)) { in PyByteArray_Resize()
227 Py_MIN((size_t)requested_size, (size_t)Py_SIZE(self))); in PyByteArray_Resize()
288 return Py_SIZE(self); in bytearray_length()
303 size = Py_SIZE(self); in bytearray_iconcat()
328 mysize = Py_SIZE(self); in bytearray_repeat()
355 mysize = Py_SIZE(self); in bytearray_irepeat()
378 if (i < 0 || i >= Py_SIZE(self)) { in bytearray_getitem()
397 if (i < 0 || i >= Py_SIZE(self)) { in bytearray_subscript()
476 Py_SIZE(self) - hi); in bytearray_setslice_linear()
[all …]
Dbytesobject.c1231 return Py_SIZE(op); in PyBytes_Size()
1295 Py_ssize_t i, length = Py_SIZE(op); in PyBytes_Repr()
1387 return Py_SIZE(a); in bytes_length()
1450 if (n > 0 && Py_SIZE(a) > PY_SSIZE_T_MAX / n) { in bytes_repeat()
1455 size = Py_SIZE(a) * n; in bytes_repeat()
1456 if (size == Py_SIZE(a) && PyBytes_CheckExact(a)) { in bytes_repeat()
1473 if (Py_SIZE(a) == 1 && n > 0) { in bytes_repeat()
1479 memcpy(op->ob_sval, a->ob_sval, Py_SIZE(a)); in bytes_repeat()
1480 i = Py_SIZE(a); in bytes_repeat()
1499 if (i < 0 || i >= Py_SIZE(a)) { in bytes_item()
[all …]
Dstructseq.c45 #define VISIBLE_SIZE(op) Py_SIZE(op)
Dobject.c1079 Py_ssize_t tsize = Py_SIZE(obj); in _PyObject_GetDictPtr()
1257 Py_ssize_t tsize = Py_SIZE(obj); in _PyObject_GenericGetAttrWithDict()
Dtypeobject.c1193 n = Py_SIZE(type); in traverse_slots()
1220 if (Py_SIZE(base)) { in subtype_traverse()
1257 n = Py_SIZE(type); in clear_slots()
1282 if (Py_SIZE(base)) in subtype_clear()
1424 if (Py_SIZE(base)) in subtype_dealloc()
5433 res = Py_SIZE(self) * isize; in object___sizeof___impl()
7159 if (Py_SIZE(res) < 0) { in slot_sq_length()
Dframeobject.c808 if (Py_SIZE(f) < extras) { in frame_alloc()
Dmemoryobject.c1205 assert(Py_SIZE(mv) == 3*view->ndim); in cast_to_1D()
1304 assert(Py_SIZE(mv) == 3*(ndim==0?1:ndim)); /* ndim of result array */ in cast_to_ND()
/third_party/python/Include/internal/
Dpycore_blocks_output_buffer.h193 const Py_ssize_t list_len = Py_SIZE(buffer->list); in _BlocksOutputBuffer_Grow()
265 const Py_ssize_t list_len = Py_SIZE(buffer->list); in _BlocksOutputBuffer_Finish()
269 (list_len == 2 && Py_SIZE(PyList_GET_ITEM(buffer->list, 1)) == avail_out)) in _BlocksOutputBuffer_Finish()
293 memcpy(posi, PyBytes_AS_STRING(block), Py_SIZE(block)); in _BlocksOutputBuffer_Finish()
294 posi += Py_SIZE(block); in _BlocksOutputBuffer_Finish()
298 memcpy(posi, PyBytes_AS_STRING(block), Py_SIZE(block) - avail_out); in _BlocksOutputBuffer_Finish()
300 assert(Py_SIZE(result) == 0); in _BlocksOutputBuffer_Finish()
/third_party/python/Python/
Dhamt.c558 return Py_SIZE(node) / 2; in hamt_node_bitmap_count()
569 clone = (PyHamtNode_Bitmap *)hamt_node_bitmap_new(Py_SIZE(node)); in hamt_node_bitmap_clone()
574 for (i = 0; i < Py_SIZE(node); i++) { in hamt_node_bitmap_clone()
590 Py_SIZE(o) - 2); in hamt_node_bitmap_clone_without()
605 assert(Py_SIZE(o) >= 0 && Py_SIZE(o) <= 32); in hamt_node_bitmap_clone_without()
606 for (i = val_idx + 1; i < (uint32_t)Py_SIZE(o); i++) { in hamt_node_bitmap_clone_without()
714 assert(val_idx < (size_t)Py_SIZE(self)); in hamt_node_bitmap_assoc()
933 assert(Py_SIZE(self) >= 0 && Py_SIZE(self) <= 32); in hamt_node_bitmap_assoc()
934 for (i = key_idx; i < (uint32_t)Py_SIZE(self); i++) { in hamt_node_bitmap_assoc()
1108 assert(val_idx < (size_t)Py_SIZE(self)); in hamt_node_bitmap_find()
[all …]
Dast_opt.c140 if (PyLong_Check(v) && PyLong_Check(w) && Py_SIZE(v) && Py_SIZE(w)) { in safe_multiply()
186 if (PyLong_Check(v) && PyLong_Check(w) && Py_SIZE(v) && Py_SIZE(w) > 0) { in safe_power()
203 if (PyLong_Check(v) && PyLong_Check(w) && Py_SIZE(v) && Py_SIZE(w)) { in safe_lshift()
Dmarshal.c233 if (Py_SIZE(ob) == 0) { in w_PyLong()
239 n = Py_ABS(Py_SIZE(ob)); in w_PyLong()
252 w_long((long)(Py_SIZE(ob) > 0 ? l : -l), p); in w_PyLong()
/third_party/python/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.h21 #define PyTuple_GET_SIZE(op) Py_SIZE(_PyTuple_CAST(op))
Dlistobject.h34 #define PyList_GET_SIZE(op) Py_SIZE(_PyList_CAST(op))
Dbytesobject.h34 #define PyBytes_GET_SIZE(op) (assert(PyBytes_Check(op)),Py_SIZE(op))
/third_party/python/Include/
Dobject.h140 #define Py_SIZE(ob) (_PyVarObject_CAST(ob)->ob_size) macro
/third_party/python/Doc/c-api/
Dstructures.rst41 :c:macro:`Py_REFCNT`, :c:macro:`Py_TYPE`, and :c:macro:`Py_SIZE`.
136 .. c:function:: Py_ssize_t Py_SIZE(const PyVarObject *o)
/third_party/python/Misc/NEWS.d/
D3.10.0a3.rst1326 Convert :c:func:`Py_TYPE` and :c:func:`Py_SIZE` back to macros to allow
1328 ability of using Py_TYPE() and Py_SIZE() to set an object type and size:
1329 ``Py_TYPE(obj) = type;`` and ``Py_SIZE(obj) = size;``.

12