mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-17 17:54:32 +08:00
Fixed error on Windows [skip ci]
This commit is contained in:
@@ -104,9 +104,9 @@
|
|||||||
|
|
||||||
/* Pointer macros */
|
/* Pointer macros */
|
||||||
#define HnswPtrAccess(base, hp) ((base) == NULL ? (hp).ptr : relptr_access(base, (hp).relptr))
|
#define HnswPtrAccess(base, hp) ((base) == NULL ? (hp).ptr : relptr_access(base, (hp).relptr))
|
||||||
#define HnswPtrStore(base, hp, value) ((base) == NULL ? (hp).ptr = (value) : (void) relptr_store(base, (hp).relptr, value))
|
#define HnswPtrStore(base, hp, value) ((base) == NULL ? (void) ((hp).ptr = (value)) : (void) relptr_store(base, (hp).relptr, value))
|
||||||
#define HnswPtrIsNull(base, hp) ((base) == NULL ? (hp).ptr == NULL : relptr_is_null((hp).relptr))
|
#define HnswPtrIsNull(base, hp) ((base) == NULL ? (hp).ptr == NULL : relptr_is_null((hp).relptr))
|
||||||
#define HnswPtrSetNull(base, hp) ((base) == NULL ? (hp).ptr = NULL : (void) ((hp).relptr.relptr_off = 0))
|
#define HnswPtrSetNull(base, hp) ((base) == NULL ? (void) ((hp).ptr = NULL) : (void) ((hp).relptr.relptr_off = 0))
|
||||||
#define HnswPtrEqual(base, hp1, hp2) ((base) == NULL ? (hp1).ptr == (hp2).ptr : relptr_offset((hp1).relptr) == relptr_offset((hp2).relptr))
|
#define HnswPtrEqual(base, hp1, hp2) ((base) == NULL ? (hp1).ptr == (hp2).ptr : relptr_offset((hp1).relptr) == relptr_offset((hp2).relptr))
|
||||||
|
|
||||||
/* For code paths dedicated to each type */
|
/* For code paths dedicated to each type */
|
||||||
@@ -439,8 +439,8 @@ void hnswrescan(IndexScanDesc scan, ScanKey keys, int nkeys, ScanKey orderbys,
|
|||||||
bool hnswgettuple(IndexScanDesc scan, ScanDirection dir);
|
bool hnswgettuple(IndexScanDesc scan, ScanDirection dir);
|
||||||
void hnswendscan(IndexScanDesc scan);
|
void hnswendscan(IndexScanDesc scan);
|
||||||
|
|
||||||
static inline
|
static inline HnswNeighborArray *
|
||||||
HnswNeighborArray * HnswGetNeighbors(char *base, HnswElement element, int lc)
|
HnswGetNeighbors(char *base, HnswElement element, int lc)
|
||||||
{
|
{
|
||||||
HnswNeighborArrayPtr *neighborList = HnswPtrAccess(base, element->neighbors);
|
HnswNeighborArrayPtr *neighborList = HnswPtrAccess(base, element->neighbors);
|
||||||
|
|
||||||
|
|||||||
@@ -697,13 +697,16 @@ AddToVisited(char *base, visited_hash v, HnswCandidate * hc, Relation index, boo
|
|||||||
static inline bool
|
static inline bool
|
||||||
CountElement(char *base, HnswElement skipElement, HnswCandidate * hc)
|
CountElement(char *base, HnswElement skipElement, HnswCandidate * hc)
|
||||||
{
|
{
|
||||||
|
HnswElement e;
|
||||||
|
|
||||||
if (skipElement == NULL)
|
if (skipElement == NULL)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
/* Ensure does not access heaptidsLength during in-memory build */
|
/* Ensure does not access heaptidsLength during in-memory build */
|
||||||
pg_memory_barrier();
|
pg_memory_barrier();
|
||||||
|
|
||||||
return HnswPtrAccess(base, hc->element)->heaptidsLength != 0;
|
e = HnswPtrAccess(base, hc->element);
|
||||||
|
return e->heaptidsLength != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user