Fixed invalid memory alloc request size error - fixes #43

This commit is contained in:
Andrew Kane
2022-11-17 14:12:49 -08:00
parent b7c5849ba7
commit ccec96ba54
2 changed files with 5 additions and 1 deletions

View File

@@ -1,3 +1,7 @@
## 0.3.2 (unreleased)
- Fixed `invalid memory alloc request size` error
## 0.3.1 (2022-11-02)
If upgrading from 0.2.7 or 0.3.0, [recreate](https://github.com/pgvector/pgvector#031) all `ivfflat` indexes after upgrading to ensure all data is indexed.

View File

@@ -10,7 +10,7 @@
VectorArray
VectorArrayInit(int maxlen, int dimensions)
{
VectorArray res = palloc0(VECTOR_ARRAY_SIZE(maxlen, dimensions));
VectorArray res = palloc_extended(VECTOR_ARRAY_SIZE(maxlen, dimensions), MCXT_ALLOC_ZERO | MCXT_ALLOC_HUGE);
res->length = 0;
res->maxlen = maxlen;