mirror of
https://github.com/pgvector/pgvector.git
synced 2026-06-30 01:31:15 +08:00
Improved memory clean-up [skip ci]
This commit is contained in:
@@ -183,6 +183,9 @@ CreateElementPages(HnswBuildState * buildstate)
|
||||
UnlockReleaseBuffer(buf);
|
||||
|
||||
HnswUpdateMetaPage(index, true, buildstate->entryPoint, insertPage, forkNum);
|
||||
|
||||
pfree(etup);
|
||||
pfree(ntup);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -227,6 +230,8 @@ CreateNeighborPages(HnswBuildState * buildstate)
|
||||
GenericXLogFinish(state);
|
||||
UnlockReleaseBuffer(buf);
|
||||
}
|
||||
|
||||
pfree(ntup);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -430,6 +435,7 @@ InitBuildState(HnswBuildState * buildstate, Relation heap, Relation index, Index
|
||||
static void
|
||||
FreeBuildState(HnswBuildState * buildstate)
|
||||
{
|
||||
pfree(buildstate->normvec);
|
||||
MemoryContextDelete(buildstate->tmpCtx);
|
||||
}
|
||||
|
||||
|
||||
@@ -611,7 +611,7 @@ HnswInitElement(ItemPointer heaptid, int m, double ml, int maxLevel)
|
||||
void
|
||||
HnswFreeElement(HnswElement element)
|
||||
{
|
||||
list_free(element->heaptids);
|
||||
list_free_deep(element->heaptids);
|
||||
for (int lc = 0; lc <= element->level; lc++)
|
||||
pfree(element->neighbors[lc].items);
|
||||
pfree(element->neighbors);
|
||||
|
||||
Reference in New Issue
Block a user