Lines Matching refs:unitbytes
19 size_t unitbytes; member
30 …alloc = PetscMax(s->used + count, PetscMin(1000000 / ((PetscCount)seg->unitbytes) + 1, s->alloc + … in PetscSegBufferAlloc_Private()
31 …PetscCall(PetscMalloc(offsetof(struct _PetscSegBufferLink, u) + alloc * seg->unitbytes, &newlink)); in PetscSegBufferAlloc_Private()
58 PetscErrorCode PetscSegBufferCreate(size_t unitbytes, PetscCount expected, PetscSegBuffer *seg) in PetscSegBufferCreate() argument
64 PetscCall(PetscMalloc(offsetof(struct _PetscSegBufferLink, u) + expected * unitbytes, &head)); in PetscSegBufferCreate()
68 (*seg)->unitbytes = unitbytes; in PetscSegBufferCreate()
98 *(char **)buf = &s->u.array[s->used * seg->unitbytes]; in PetscSegBufferGet()
146 size_t unitbytes; in PetscSegBufferExtractTo() local
151 unitbytes = seg->unitbytes; in PetscSegBufferExtractTo()
153 ptr = PetscSafePointerPlusOffset((char *)contig, s->tailused * unitbytes); in PetscSegBufferExtractTo()
154 PetscCall(PetscMemcpy(ptr, s->u.array, s->used * unitbytes)); in PetscSegBufferExtractTo()
157 ptr -= t->used * unitbytes; in PetscSegBufferExtractTo()
158 PetscCall(PetscMemcpy(ptr, t->u.array, t->used * unitbytes)); in PetscSegBufferExtractTo()
196 PetscCall(PetscMalloc((s->used + s->tailused) * seg->unitbytes, &contig)); in PetscSegBufferExtractAlloc()
226 PetscCall(PetscSegBufferCreate(seg->unitbytes, head->used + head->tailused, &newseg)); in PetscSegBufferExtractInPlace()