Fixed Valgrind check for HNSW in-memory, parallel index builds - closes #441

This commit is contained in:
Andrew Kane
2024-01-28 16:19:32 -08:00
parent 0cc883b944
commit ba2776850b

View File

@@ -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