mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-09 22:30:58 +08:00
Remove offsethash
The original motivation was to eliminate the superfluous HnswPtrAccess call from AddToVisited. The caller has to call HnswPtrAccess() anyway, so it makes sense to pass the HnswElement rather than HnswElementPtr to AddToVisited(). But then I realized that we can use the pointer-variant even with shared memory, because the visited-hash is backend-private, and the addresses where the elements are mapped to in shared memory are stable within the backend.
This commit is contained in:
13
src/hnsw.h
13
src/hnsw.h
@@ -445,17 +445,4 @@ typedef struct PointerHashEntry
|
||||
#define SH_DECLARE
|
||||
#include "lib/simplehash.h"
|
||||
|
||||
typedef struct OffsetHashEntry
|
||||
{
|
||||
Size offset;
|
||||
char status;
|
||||
} OffsetHashEntry;
|
||||
|
||||
#define SH_PREFIX offsethash
|
||||
#define SH_ELEMENT_TYPE OffsetHashEntry
|
||||
#define SH_KEY_TYPE Size
|
||||
#define SH_SCOPE extern
|
||||
#define SH_DECLARE
|
||||
#include "lib/simplehash.h"
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user