• Home
  • Raw
  • Download

Lines Matching refs:itemsize

26     int itemsize;  member
78 if (_new_size <= ((~(size_t)0) / self->ob_descr->itemsize)) in array_resize()
79 PyMem_RESIZE(items, char, (_new_size * self->ob_descr->itemsize)); in array_resize()
426 nbytes = size * descr->itemsize; in newarrayobject()
428 if (nbytes / descr->itemsize != (size_t)size) { in newarrayobject()
486 memmove(items + (where+1)*self->ob_descr->itemsize, in ins1()
487 items + where*self->ob_descr->itemsize, in ins1()
488 (n-where)*self->ob_descr->itemsize); in ins1()
624 memcpy(np->ob_item, a->ob_item + ilow * a->ob_descr->itemsize, in array_slice()
625 (ihigh-ilow) * a->ob_descr->itemsize); in array_slice()
666 memcpy(np->ob_item, a->ob_item, Py_SIZE(a)*a->ob_descr->itemsize); in array_concat()
669 memcpy(np->ob_item + Py_SIZE(a)*a->ob_descr->itemsize, in array_concat()
670 b->ob_item, Py_SIZE(b)*b->ob_descr->itemsize); in array_concat()
696 nbytes = Py_SIZE(a) * a->ob_descr->itemsize; in array_repeat()
749 memmove(item + (ihigh+d)*a->ob_descr->itemsize, in array_ass_slice()
750 item + ihigh*a->ob_descr->itemsize, in array_ass_slice()
751 (Py_SIZE(a)-ihigh)*a->ob_descr->itemsize); in array_ass_slice()
753 PyMem_RESIZE(item, char, Py_SIZE(a)*a->ob_descr->itemsize); in array_ass_slice()
760 (Py_SIZE(a) + d)*a->ob_descr->itemsize); in array_ass_slice()
765 memmove(item + (ihigh+d)*a->ob_descr->itemsize, in array_ass_slice()
766 item + ihigh*a->ob_descr->itemsize, in array_ass_slice()
767 (Py_SIZE(a)-ihigh)*a->ob_descr->itemsize); in array_ass_slice()
773 memcpy(item + ilow*a->ob_descr->itemsize, b->ob_item, in array_ass_slice()
774 n*b->ob_descr->itemsize); in array_ass_slice()
837 ((Py_SIZE(self) + Py_SIZE(b)) > PY_SSIZE_T_MAX / self->ob_descr->itemsize)) { in array_do_extend()
843 PyMem_RESIZE(self->ob_item, char, size*self->ob_descr->itemsize); in array_do_extend()
850 memcpy(self->ob_item + Py_SIZE(self)*self->ob_descr->itemsize, in array_do_extend()
851 b->ob_item, Py_SIZE(b)*b->ob_descr->itemsize); in array_do_extend()
885 if ((self->ob_descr->itemsize != 0) && in array_inplace_repeat()
886 (Py_SIZE(self) > PY_SSIZE_T_MAX / self->ob_descr->itemsize)) { in array_inplace_repeat()
889 size = Py_SIZE(self) * self->ob_descr->itemsize; in array_inplace_repeat()
1130 switch (self->ob_descr->itemsize) { in array_byteswap()
1184 register Py_ssize_t itemsize = self->ob_descr->itemsize; in array_reverse() local
1188 assert((size_t)itemsize <= sizeof(tmp)); in array_reverse()
1192 q = self->ob_item + (Py_SIZE(self) - 1)*itemsize; in array_reverse()
1194 p += itemsize, q -= itemsize) { in array_reverse()
1198 memcpy(tmp, p, itemsize); in array_reverse()
1199 memcpy(p, q, itemsize); in array_reverse()
1200 memcpy(q, tmp, itemsize); in array_reverse()
1228 Py_ssize_t itemsize = self->ob_descr->itemsize; in array_fromfile() local
1234 (newbytes = newlength * itemsize) / itemsize != in array_fromfile()
1246 nread = fread(item + (Py_SIZE(self) - n) * itemsize, in array_fromfile()
1247 itemsize, n, fp); in array_fromfile()
1250 PyMem_RESIZE(item, char, Py_SIZE(self)*itemsize); in array_fromfile()
1296 if (fwrite(self->ob_item, self->ob_descr->itemsize, in array_tofile()
1328 Py_ssize_t itemsize = self->ob_descr->itemsize; in array_fromlist() local
1338 PyMem_RESIZE(item, char, (Py_SIZE(self) + n) * itemsize); in array_fromlist()
1351 if (itemsize && (self->ob_size > PY_SSIZE_T_MAX / itemsize)) { in array_fromlist()
1355 Py_SIZE(self) * itemsize); in array_fromlist()
1402 int itemsize = self->ob_descr->itemsize; in array_fromstring() local
1410 if (n % itemsize != 0) { in array_fromstring()
1415 n = n / itemsize; in array_fromstring()
1419 ((Py_SIZE(self) + n) > PY_SSIZE_T_MAX / itemsize)) { in array_fromstring()
1422 PyMem_RESIZE(item, char, (Py_SIZE(self) + n) * itemsize); in array_fromstring()
1430 memcpy(item + (Py_SIZE(self) - n) * itemsize, in array_fromstring()
1431 str, itemsize*n); in array_fromstring()
1447 if (self->ob_size <= PY_SSIZE_T_MAX / self->ob_descr->itemsize) { in array_tostring()
1449 Py_SIZE(self) * self->ob_descr->itemsize); in array_tostring()
1566 res = _PyObject_SIZE(Py_TYPE(self)) + self->allocated * self->ob_descr->itemsize; in array_sizeof()
1585 return PyInt_FromLong((long)a->ob_descr->itemsize); in array_get_itemsize()
1702 int itemsize = self->ob_descr->itemsize; in array_subscr() local
1718 self->ob_item + start * itemsize, in array_subscr()
1719 slicelength * itemsize); in array_subscr()
1730 memcpy(ar->ob_item + i*itemsize, in array_subscr()
1731 self->ob_item + cur*itemsize, in array_subscr()
1732 itemsize); in array_subscr()
1750 int itemsize; in array_ass_subscr() local
1814 itemsize = self->ob_descr->itemsize; in array_ass_subscr()
1821 memmove(self->ob_item + (start + needed) * itemsize, in array_ass_subscr()
1822 self->ob_item + stop * itemsize, in array_ass_subscr()
1823 (Py_SIZE(self) - stop) * itemsize); in array_ass_subscr()
1832 memmove(self->ob_item + (start + needed) * itemsize, in array_ass_subscr()
1833 self->ob_item + stop * itemsize, in array_ass_subscr()
1834 (Py_SIZE(self) - start - needed) * itemsize); in array_ass_subscr()
1837 memcpy(self->ob_item + start * itemsize, in array_ass_subscr()
1838 other->ob_item, needed * itemsize); in array_ass_subscr()
1857 memmove(self->ob_item + (cur - i) * itemsize, in array_ass_subscr()
1858 self->ob_item + (cur + 1) * itemsize, in array_ass_subscr()
1859 lim * itemsize); in array_ass_subscr()
1863 memmove(self->ob_item + (cur-slicelength) * itemsize, in array_ass_subscr()
1864 self->ob_item + cur * itemsize, in array_ass_subscr()
1865 (Py_SIZE(self) - cur) * itemsize); in array_ass_subscr()
1883 memcpy(self->ob_item + cur * itemsize, in array_ass_subscr()
1884 other->ob_item + i * itemsize, in array_ass_subscr()
1885 itemsize); in array_ass_subscr()
1910 return Py_SIZE(self)*self->ob_descr->itemsize; in array_buffer_getreadbuf()
1924 return Py_SIZE(self)*self->ob_descr->itemsize; in array_buffer_getwritebuf()
1931 *lenp = Py_SIZE(self)*self->ob_descr->itemsize; in array_buffer_getsegcount()