Lines Matching refs:itemsize
210 ((view)->shape[0] == 1 || (view)->strides[0] == (view)->itemsize)
234 with the same logical structure: format, itemsize, ndim and shape
252 dest->strides[dest->ndim-1] == dest->itemsize &&
253 src->strides[src->ndim-1] == src->itemsize);
272 dest->itemsize != src->itemsize) {
318 sizeof(mem) == shape[0] * itemsize. */
320 copy_base(const Py_ssize_t *shape, Py_ssize_t itemsize,
326 Py_ssize_t size = shape[0] * itemsize;
335 for (i=0, p=mem; i < shape[0]; p+=itemsize, sptr+=sstrides[0], i++) {
337 memcpy(p, xsptr, itemsize);
339 for (i=0, p=mem; i < shape[0]; p+=itemsize, dptr+=dstrides[0], i++) {
341 memcpy(xdptr, p, itemsize);
348 have the same ndim, shape and itemsize. */
350 copy_rec(const Py_ssize_t *shape, Py_ssize_t ndim, Py_ssize_t itemsize,
360 copy_base(shape, itemsize,
371 copy_rec(shape+1, ndim-1, itemsize,
390 mem = PyMem_Malloc(dest->shape[0] * dest->itemsize);
397 copy_base(dest->shape, dest->itemsize,
422 mem = PyMem_Malloc(dest->shape[dest->ndim-1] * dest->itemsize);
429 copy_rec(dest->shape, dest->ndim, dest->itemsize,
448 view->strides[view->ndim-1] = view->itemsize;
461 view->strides[0] = view->itemsize;
522 dest->itemsize = src->itemsize;
540 dest->shape[0] = src->shape ? src->shape[0] : src->len / src->itemsize;
541 dest->strides[0] = src->strides ? src->strides[0] : src->itemsize;
569 /* len = product(shape) * itemsize */
578 len *= view->itemsize;
863 /* shared values are initialized correctly except for itemsize */
864 dest->itemsize = src->itemsize;
1172 input array. Thus, view->len must be a multiple of the new itemsize. */
1179 Py_ssize_t itemsize;
1192 itemsize = get_native_fmtchar(&destchar, PyBytes_AS_STRING(asciifmt));
1193 if (itemsize < 0) {
1206 if (view->len % itemsize) {
1208 "memoryview: length is not a multiple of itemsize");
1219 view->itemsize = itemsize;
1222 view->shape[0] = view->len / view->itemsize;
1223 view->strides[0] = view->itemsize;
1238 Py_ssize_t itemsize)
1241 Py_ssize_t len = itemsize;
1291 len = view->itemsize;
1294 len = copy_shape(view->shape, shape, ndim, view->itemsize);
1302 "memoryview: product(shape) * itemsize != buffer size");
1423 view->itemsize is the _previous_ itemsize. If shape is present,
1424 the equality product(shape) * itemsize = len still holds at this
1425 point. The equality calcsize(format) = itemsize does _not_ hold
1469 /* product(shape) * itemsize = len and calcsize(format) = itemsize
1883 Py_ssize_t itemsize; /* len(item) */
1899 x->itemsize = 0;
1917 struct_get_unpacker(const char *fmt, Py_ssize_t itemsize)
1950 x->item = PyMem_Malloc(itemsize);
1955 x->itemsize = itemsize;
1957 x->mview = PyMemoryView_FromMemory(x->item, itemsize, PyBUF_WRITE);
1980 memcpy(x->item, ptr, x->itemsize);
2484 dest.len = dest.shape[0] * dest.itemsize;
2772 unpack_v = struct_get_unpacker(vv->format, vv->itemsize);
2777 unpack_w = struct_get_unpacker(ww->format, ww->itemsize);
2936 return PyLong_FromSsize_t(self->view.itemsize);
3030 {"itemsize", (getter)memory_itemsize_get, NULL, memory_itemsize_doc},