mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-14 16:46:54 +08:00
Fixed Valgrind check for HNSW in-memory, parallel index builds - closes #441
This commit is contained in:
@@ -7,6 +7,7 @@
|
|||||||
#include "lib/pairingheap.h"
|
#include "lib/pairingheap.h"
|
||||||
#include "storage/bufmgr.h"
|
#include "storage/bufmgr.h"
|
||||||
#include "utils/datum.h"
|
#include "utils/datum.h"
|
||||||
|
#include "utils/memdebug.h"
|
||||||
#include "utils/rel.h"
|
#include "utils/rel.h"
|
||||||
#include "vector.h"
|
#include "vector.h"
|
||||||
|
|
||||||
@@ -983,6 +984,10 @@ SelectNeighbors(char *base, List *c, int lm, int lc, FmgrInfo *procinfo, Oid col
|
|||||||
e->closer = CheckElementCloser(base, e, r, procinfo, collation);
|
e->closer = CheckElementCloser(base, e, r, procinfo, collation);
|
||||||
else if (list_length(added) > 0)
|
else if (list_length(added) > 0)
|
||||||
{
|
{
|
||||||
|
/* Keep Valgrind happy for in-memory, parallel builds */
|
||||||
|
if (base != NULL)
|
||||||
|
VALGRIND_MAKE_MEM_DEFINED(&e->closer, 1);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the current candidate was closer, we only need to compare it
|
* If the current candidate was closer, we only need to compare it
|
||||||
* with the other candidates that we have added.
|
* with the other candidates that we have added.
|
||||||
@@ -1015,6 +1020,10 @@ SelectNeighbors(char *base, List *c, int lm, int lc, FmgrInfo *procinfo, Oid col
|
|||||||
added = lappend(added, e);
|
added = lappend(added, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Keep Valgrind happy for in-memory, parallel builds */
|
||||||
|
if (base != NULL)
|
||||||
|
VALGRIND_MAKE_MEM_DEFINED(&e->closer, 1);
|
||||||
|
|
||||||
if (e->closer)
|
if (e->closer)
|
||||||
r = lappend(r, e);
|
r = lappend(r, e);
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user