mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-06 20:50:57 +08:00
Free memory [skip ci]
This commit is contained in:
@@ -938,10 +938,14 @@ HnswSearchLayer(char *base, Datum q, List *ep, int ef, int lc, Relation index, F
|
||||
/* No need to decrement wlen */
|
||||
if (wlen > ef)
|
||||
{
|
||||
HnswCandidate *hc = HnswGetPairingHeapCandidate(w_node, pairingheap_remove_first(W));
|
||||
HnswPairingHeapNode *node = pairingheap_container(HnswPairingHeapNode, w_node, pairingheap_remove_first(W));
|
||||
HnswCandidate *hc = node->inner;
|
||||
|
||||
if (discarded != NULL)
|
||||
*discarded = lappend(*discarded, hc);
|
||||
|
||||
/* TODO */
|
||||
/* pfree(node); */
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -950,9 +954,12 @@ HnswSearchLayer(char *base, Datum q, List *ep, int ef, int lc, Relation index, F
|
||||
/* Add each element of W to w */
|
||||
while (!pairingheap_is_empty(W))
|
||||
{
|
||||
HnswCandidate *hc = HnswGetPairingHeapCandidate(w_node, pairingheap_remove_first(W));
|
||||
HnswPairingHeapNode *node = pairingheap_container(HnswPairingHeapNode, w_node, pairingheap_remove_first(W));
|
||||
HnswCandidate *hc = node->inner;
|
||||
|
||||
w = lappend(w, hc);
|
||||
|
||||
pfree(node);
|
||||
}
|
||||
|
||||
return w;
|
||||
|
||||
Reference in New Issue
Block a user