You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ha...@apache.org on 2025/08/31 23:38:04 UTC
(skywalking-banyandb) 18/18: Refactor block tag handling in release and reset functions to ensure proper memory management. Removed redundant tag filter release logic and integrated filter checks during tag data release.
This is an automated email from the ASF dual-hosted git repository.
hanahmily pushed a commit to branch trace/sidx
in repository https://gitbox.apache.org/repos/asf/skywalking-banyandb.git
commit 2f253c4dbb62f34895269e90619d4cf678dace45
Author: Gao Hongtao <ha...@gmail.com>
AuthorDate: Mon Sep 1 07:20:21 2025 +0800
Refactor block tag handling in release and reset functions to ensure proper memory management. Removed redundant tag filter release logic and integrated filter checks during tag data release.
---
banyand/internal/sidx/block.go | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/banyand/internal/sidx/block.go b/banyand/internal/sidx/block.go
index 5dfa535f..a584d73b 100644
--- a/banyand/internal/sidx/block.go
+++ b/banyand/internal/sidx/block.go
@@ -65,13 +65,6 @@ func releaseBlock(b *block) {
if b == nil {
return
}
- // Release tag filters back to pool
- for _, tag := range b.tags {
- if tag.filter != nil {
- releaseBloomFilter(tag.filter)
- }
- releaseTagData(tag)
- }
b.reset()
blockPool.Put(b)
}
@@ -86,8 +79,11 @@ func (b *block) reset() {
b.data = b.data[:0]
// Clear tag map but keep the map itself
- for k := range b.tags {
- releaseTagData(b.tags[k])
+ for k, tag := range b.tags {
+ if tag.filter != nil {
+ releaseBloomFilter(tag.filter)
+ }
+ releaseTagData(tag)
delete(b.tags, k)
}
}