From 5834b58c5ae0d14c1c28f17df91b0bcff01f9189 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Thu, 11 Apr 2024 09:43:35 -0700 Subject: [PATCH] Moved VECTOR_SIZE out of IVFFLAT_LIST_SIZE [skip ci] --- src/ivfbuild.c | 2 +- src/ivfflat.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ivfbuild.c b/src/ivfbuild.c index fa7a17a..40661b3 100644 --- a/src/ivfbuild.c +++ b/src/ivfbuild.c @@ -482,7 +482,7 @@ CreateListPages(Relation index, VectorArray centers, int dimensions, Size listSize; IvfflatList list; - listSize = MAXALIGN(IVFFLAT_LIST_SIZE(dimensions)); + listSize = MAXALIGN(IVFFLAT_LIST_SIZE(VECTOR_SIZE(dimensions))); list = palloc0(listSize); buf = IvfflatNewBuffer(index, forkNum); diff --git a/src/ivfflat.h b/src/ivfflat.h index 149dc20..3ca6fe9 100644 --- a/src/ivfflat.h +++ b/src/ivfflat.h @@ -54,7 +54,7 @@ typedef enum IvfflatType #define PROGRESS_IVFFLAT_PHASE_ASSIGN 3 #define PROGRESS_IVFFLAT_PHASE_LOAD 4 -#define IVFFLAT_LIST_SIZE(_dim) (offsetof(IvfflatListData, center) + VECTOR_SIZE(_dim)) +#define IVFFLAT_LIST_SIZE(size) (offsetof(IvfflatListData, center) + size) #define IvfflatPageGetOpaque(page) ((IvfflatPageOpaque) PageGetSpecialPointer(page)) #define IvfflatPageGetMeta(page) ((IvfflatMetaPageData *) PageGetContents(page))