Skip to content

Commit

Permalink
remove padding
Browse files Browse the repository at this point in the history
Signed-off-by: you06 <you1474600@gmail.com>
  • Loading branch information
you06 committed Nov 19, 2024
1 parent 7420e0c commit 2859653
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions pkg/kv/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ type KeyRange struct {
StartKey Key
EndKey Key

XXXNoUnkeyedLiteral struct{}
XXXunrecognized []byte
XXXsizecache int32
//XXXNoUnkeyedLiteral struct{}
//XXXunrecognized []byte
//XXXsizecache int32
}

// KeyRangeSliceMemUsage return the memory usage of []KeyRange
Expand All @@ -110,7 +110,7 @@ func KeyRangeSliceMemUsage(k []KeyRange) int64 {

res := sizeofKeyRange * int64(cap(k))
for _, m := range k {
res += int64(cap(m.StartKey)) + int64(cap(m.EndKey)) + int64(cap(m.XXXunrecognized))
res += int64(cap(m.StartKey)) + int64(cap(m.EndKey)) //+ int64(cap(m.XXXunrecognized))
}

return res
Expand Down
2 changes: 1 addition & 1 deletion pkg/kv/key_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ func TestKeyRangeDefinition(t *testing.T) {
StartKey: []byte("s2"),
EndKey: []byte("e2"),
}}
require.Equal(t, int64(168), KeyRangeSliceMemUsage(s))
require.Equal(t, int64(104), KeyRangeSliceMemUsage(s))
}

func BenchmarkIsPoint(b *testing.B) {
Expand Down

0 comments on commit 2859653

Please sign in to comment.