Commit 65ac9f1
committed
Roaring Bitmap: address PR review feedback
1. RoaringBitmapDataTests: cast actual0 to int when indexing bool[];
add an explicit non-negative guard for clarity.
2. RoaringBitmap.ByteSize: docstring now states the per-entry
SortedDictionary node overhead is included (the implementation
already accounted for it).
3. RSetBit.NeedInitialUpdate: validate offset/value against a copy
of the input before the framework allocates an empty object;
write the error and return false on bad input so malformed
R.SETBIT no longer leaves an empty key behind.
4. RoaringBitmapObject default ctor: align Size with the deserialized
ctor by setting Size = ObjectOverhead + bitmap.ByteSize so
freshly-created and round-tripped objects report identical memory
baselines and later ByteSize-based deltas don't double-count.
5. (Reviewer suggested removing 'using Garnet.common;' as unused;
that namespace owns RespMemoryWriter and is required, so the
using stays.)
All 27 data-structure + 14 RESP integration tests still pass.1 parent facd8fe commit 65ac9f1
4 files changed
Lines changed: 35 additions & 5 deletions
File tree
- main/GarnetServer/Extensions/RoaringBitmap
- test/Garnet.test
Lines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
181 | | - | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
182 | 186 | | |
183 | 187 | | |
184 | 188 | | |
185 | 189 | | |
186 | | - | |
| 190 | + | |
187 | 191 | | |
188 | 192 | | |
189 | | - | |
| 193 | + | |
| 194 | + | |
190 | 195 | | |
191 | 196 | | |
192 | 197 | | |
| |||
Lines changed: 22 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
51 | 72 | | |
52 | 73 | | |
53 | 74 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
30 | 34 | | |
31 | 35 | | |
32 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
175 | | - | |
| 175 | + | |
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
| |||
0 commit comments