Skip to content

Commit

Permalink
Fix usearch insertion asserts
Browse files Browse the repository at this point in the history
  • Loading branch information
Ngalstyan4 committed Aug 5, 2023
1 parent bf2e173 commit 34fa5e5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[submodule "third_party/usearch"]
path = third_party/usearch
url = https://github.com/ngalstyan4/usearch
branch = pg
branch = pg-rebase
[submodule "third_party/hnswlib"]
path = third_party/hnswlib
url = https://github.com/ngalstyan4/hnswlib
Expand Down
3 changes: 2 additions & 1 deletion src/hnsw/insert.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ bool ldb_aminsert(Relation index,
// including for locks according to size indicated in usearch_mem
// ^^ do not worry about allocaitng locks above. but that has to be eliminated down the line
usearch_view_mem_lazy(uidx, hdr->usearch_header, &error);
assert(!error);

indexInfo->ii_AmCache = uidx;

Expand All @@ -139,8 +140,8 @@ bool ldb_aminsert(Relation index,
}

uidx = (usearch_index_t)indexInfo->ii_AmCache;
assert(!error);
meta = usearch_metadata(uidx, &error);
assert(!error);

insertCtx = AllocSetContextCreate(CurrentMemoryContext, "LanternInsertContext", ALLOCSET_DEFAULT_SIZES);
oldCtx = MemoryContextSwitchTo(insertCtx);
Expand Down

0 comments on commit 34fa5e5

Please sign in to comment.