Skip to content

Commit

Permalink
Plugging memory leaks (#60)
Browse files Browse the repository at this point in the history
* Reference value in resultVector

To get rid of as much pointer logic as possible

* Using namespace std

* Applying more unique_ptr semantics

* More heap cleanups

* Naming conventions + cleanups

* Code formatting

* Formatting + getting rid of heap object (write)

* Getting rid of more leaks + formatting

* Getting rid of more heap memory

* Getting rid of more heap memory logic + code formating

* WAY better vectors logic for inserts/deletes/trainings

* Removing dead code

* Significant cleanup

* Update sqlite-vector.cpp

* Making sure we compile on mac + cleanups

* Update sqlite-vss.cpp

* Better error messages

* Way better memory handling

* Fixing array out of bounds error

* Making sure we resize vector before invoking search

* Update sqlite-vss.cpp

* Temporary rearranging workflows to trigger build

* Resetting pipelines back again

* Update sqlite-vss.cpp

* Update sqlite-vss.cpp

* Shrinking vectors

* shrink to fit for vectors

* More shrink to fit

* Update sqlite-vss.cpp

* Update sqlite-vss.cpp

* Memory leak fix

* Update sqlite-vector.cpp

* Update sqlite-vector.cpp

* Update sqlite-vss.cpp

* Minor changes

* Fixing unit tests

* Fixing tests

* Update test-loadable.py

* Update test-loadable.py

* Update test-loadable.py

* Update sqlite-vss.cpp

* Last touches

* Resetting workflow files back to original state

* Removing size check

If we use PCA to reduce dimensions, size check will fail.

* Revert "Removing size check"

This reverts commit 472308d.

* Catching exceptions and returning as errors

* By changing to sqlite3_create_function_v2 it returns success

Changing from sqlite3_create_function to sqlite3_create_function_v2 fixes the creation of the vector0 function. It's in general a bad habit of "mixing APIs", so I guess this explains the weird bug where sqlite3_create_function wouldn't return success.

* See comments

1. Changed from pointer logic to unique_ptr for range_search_result
2. Consistent usage of SQL inline in code
3. Minor code cleanups and simplifications
4. More error checking

---------

Co-authored-by: thomas-hansen-resolve <[email protected]>
  • Loading branch information
polterguy and thomas-hansen-resolve authored Jun 21, 2023
1 parent 0cf1b83 commit 927b52a
Show file tree
Hide file tree
Showing 8 changed files with 2,040 additions and 1,599 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -361,4 +361,4 @@ jobs:
- run: cargo publish --no-verify
working-directory: ./bindings/rust
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/upload-deno-assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ module.exports = async ({ github, context }) => {
})
);
return outputAssetChecksums.map((d) => `${d.checksum} ${d.name}`).join("\n");
};
};
2 changes: 1 addition & 1 deletion .github/workflows/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,4 @@ module.exports = async ({ github, context }) => {
name: "spm.json",
data: JSON.stringify(spm_json),
});
};
};
Loading

0 comments on commit 927b52a

Please sign in to comment.