Added itemsize to VectorArray [skip ci]

This commit is contained in:
Andrew Kane
2024-04-11 13:47:36 -07:00
parent 5834b58c5a
commit 4ff36af67e
4 changed files with 19 additions and 17 deletions

View File

@@ -11,14 +11,15 @@
* Allocate a vector array
*/
VectorArray
VectorArrayInit(int maxlen, int dimensions)
VectorArrayInit(int maxlen, int dimensions, Size itemsize)
{
VectorArray res = palloc(sizeof(VectorArrayData));
res->length = 0;
res->maxlen = maxlen;
res->dim = dimensions;
res->items = palloc_extended(maxlen * VECTOR_SIZE(dimensions), MCXT_ALLOC_ZERO | MCXT_ALLOC_HUGE);
res->itemsize = itemsize;
res->items = palloc_extended(maxlen * itemsize, MCXT_ALLOC_ZERO | MCXT_ALLOC_HUGE);
return res;
}