@@ -740,21 +740,21 @@ CountElement(HnswElement skipElement, HnswElement e)
740
740
* Load unvisited neighbors from memory
741
741
*/
742
742
static void
743
- HnswLoadUnvisitedFromMemory (char * base , HnswElement element , HnswUnvisited * unvisited , int * unvisitedLength , visited_hash * v , int lc , HnswNeighborArray * neighborhoodData , Size neighborhoodSize )
743
+ HnswLoadUnvisitedFromMemory (char * base , HnswElement element , HnswUnvisited * unvisited , int * unvisitedLength , visited_hash * v , int lc , HnswNeighborArray * localNeighborhood , Size neighborhoodSize )
744
744
{
745
745
/* Get the neighborhood at layer lc */
746
746
HnswNeighborArray * neighborhood = HnswGetNeighbors (base , element , lc );
747
747
748
748
/* Copy neighborhood to local memory */
749
749
LWLockAcquire (& element -> lock , LW_SHARED );
750
- memcpy (neighborhoodData , neighborhood , neighborhoodSize );
750
+ memcpy (localNeighborhood , neighborhood , neighborhoodSize );
751
751
LWLockRelease (& element -> lock );
752
752
753
753
* unvisitedLength = 0 ;
754
754
755
- for (int i = 0 ; i < neighborhoodData -> length ; i ++ )
755
+ for (int i = 0 ; i < localNeighborhood -> length ; i ++ )
756
756
{
757
- HnswCandidate * hc = & neighborhoodData -> items [i ];
757
+ HnswCandidate * hc = & localNeighborhood -> items [i ];
758
758
bool found ;
759
759
760
760
AddToVisited (base , v , hc -> element , NULL , & found );
@@ -817,7 +817,7 @@ HnswSearchLayer(char *base, Datum q, List *ep, int ef, int lc, Relation index, F
817
817
int wlen = 0 ;
818
818
visited_hash v ;
819
819
ListCell * lc2 ;
820
- HnswNeighborArray * neighborhoodData = NULL ;
820
+ HnswNeighborArray * localNeighborhood = NULL ;
821
821
Size neighborhoodSize = 0 ;
822
822
int lm = HnswGetLayerM (m , lc );
823
823
HnswUnvisited * unvisited = palloc (lm * sizeof (HnswUnvisited ));
@@ -829,7 +829,7 @@ HnswSearchLayer(char *base, Datum q, List *ep, int ef, int lc, Relation index, F
829
829
if (index == NULL )
830
830
{
831
831
neighborhoodSize = HNSW_NEIGHBOR_ARRAY_SIZE (lm );
832
- neighborhoodData = palloc (neighborhoodSize );
832
+ localNeighborhood = palloc (neighborhoodSize );
833
833
}
834
834
835
835
/* Add entry points to v, C, and W */
@@ -866,7 +866,7 @@ HnswSearchLayer(char *base, Datum q, List *ep, int ef, int lc, Relation index, F
866
866
cElement = HnswPtrAccess (base , c -> element );
867
867
868
868
if (index == NULL )
869
- HnswLoadUnvisitedFromMemory (base , cElement , unvisited , & unvisitedLength , & v , lc , neighborhoodData , neighborhoodSize );
869
+ HnswLoadUnvisitedFromMemory (base , cElement , unvisited , & unvisitedLength , & v , lc , localNeighborhood , neighborhoodSize );
870
870
else
871
871
HnswLoadUnvisitedFromDisk (cElement , unvisited , & unvisitedLength , & v , index , m , lm , lc );
872
872
0 commit comments