Removed nested FLEXIBLE_ARRAY_MEMBER for Windows

This commit is contained in:
Andrew Kane
2022-12-07 19:53:48 -08:00
parent d376011087
commit 9c9489e888
2 changed files with 6 additions and 4 deletions

View File

@@ -10,11 +10,12 @@
VectorArray
VectorArrayInit(int maxlen, int dimensions)
{
VectorArray res = palloc_extended(VECTOR_ARRAY_SIZE(maxlen, dimensions), MCXT_ALLOC_ZERO | MCXT_ALLOC_HUGE);
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);
return res;
}
@@ -24,6 +25,7 @@ VectorArrayInit(int maxlen, int dimensions)
void
VectorArrayFree(VectorArray arr)
{
pfree(arr->items);
pfree(arr);
}