From 658d74e2f6e4c68e71d77c65e421988361ce1131 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Sun, 29 Sep 2024 23:48:58 -0700 Subject: [PATCH] Use Size for memory [skip ci] --- src/hnsw.h | 4 ++-- src/hnswbuild.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hnsw.h b/src/hnsw.h index c58ced1..116d9bc 100644 --- a/src/hnsw.h +++ b/src/hnsw.h @@ -185,8 +185,8 @@ typedef struct HnswGraph /* Allocations state */ LWLock allocatorLock; - long memoryUsed; - long memoryTotal; + Size memoryUsed; + Size memoryTotal; /* Flushed state */ LWLock flushLock; diff --git a/src/hnswbuild.c b/src/hnswbuild.c index 82c981b..87d4823 100644 --- a/src/hnswbuild.c +++ b/src/hnswbuild.c @@ -607,7 +607,7 @@ BuildCallback(Relation index, ItemPointer tid, Datum *values, * Initialize the graph */ static void -InitGraph(HnswGraph * graph, char *base, long memoryTotal) +InitGraph(HnswGraph * graph, char *base, Size memoryTotal) { /* Initialize the lock tranche if needed */ HnswInitLockTranche(); @@ -708,7 +708,7 @@ InitBuildState(HnswBuildState * buildstate, Relation heap, Relation index, Index buildstate->normprocinfo = HnswOptionalProcInfo(index, HNSW_NORM_PROC); buildstate->collation = index->rd_indcollation[0]; - InitGraph(&buildstate->graphData, NULL, maintenance_work_mem * 1024L); + InitGraph(&buildstate->graphData, NULL, (Size) maintenance_work_mem * 1024L); buildstate->graph = &buildstate->graphData; buildstate->ml = HnswGetMl(buildstate->m); buildstate->maxLevel = HnswGetMaxLevel(buildstate->m);