Skip to content

Commit

Permalink
Release memory properly for an array type (opensearch-project#1820)
Browse files Browse the repository at this point in the history
Signed-off-by: Heemin Kim <[email protected]>
  • Loading branch information
heemin32 authored Jul 12, 2024
1 parent 6d1b7c8 commit 31a4d3e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Enhancements
### Bug Fixes
* Fixing the arithmetic to find the number of vectors to stream from java to jni layer.[#1804](https://github.com/opensearch-project/k-NN/pull/1804)
* Release memory properly for an array type [#1820](https://github.com/opensearch-project/k-NN/pull/1820)
### Infrastructure
### Documentation
* Update dev guide to fix clang linking issue on arm [#1746](https://github.com/opensearch-project/k-NN/pull/1746)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ index 713fe8e4..d307fd70 100644
+ /// series of results for query i is done
+ void end() {
+ heap_reorder<C>(k, heap_dis, heap_ids);
+ delete heap_group_ids;
+ delete[] heap_group_ids;
+ }
+ };
+
Expand Down Expand Up @@ -527,8 +527,8 @@ index 713fe8e4..d307fd70 100644
+ for (size_t i = i0; i < i1; i++) {
+ heap_reorder<C>(k, heap_dis_tab + i * k, heap_ids_tab + i * k);
+ }
+ delete group_id_to_index_in_heap_tab;
+ delete heap_group_ids_tab;
+ delete[] group_id_to_index_in_heap_tab;
+ delete[] heap_group_ids_tab;
+ }
+};
+
Expand Down

0 comments on commit 31a4d3e

Please sign in to comment.