Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rax size tracking #688

Merged
merged 29 commits into from
Oct 2, 2024
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
12578aa
Track rax allocation size in rax header
yzhaon Jan 5, 2022
aaebb31
fix use after free, don't update the alloc field in raxFree
yzhaon Jan 21, 2022
e09bef3
Fix issues with previous attempt
knggk Jun 24, 2024
1acaa41
Add rax-test from antirez repo into Redis repo
yzhaon Feb 1, 2022
9ac6f88
replace rc4rand with twin prime generator
yzhaon Feb 1, 2022
2de1d2e
Replace usage of libc alloc fn calls with zmalloc calls
yzhaon Feb 1, 2022
4909a1f
Remove time function, remove argv parsing code
yzhaon Feb 1, 2022
eeb0f2e
Add features of the unit test as flags
yzhaon Feb 1, 2022
88cbb16
Fix rax-test so that it compiles and tests pass
knggk Jun 25, 2024
f66ba88
Move rax-test.c under src/unit/test_rax.c
knggk Jun 27, 2024
77f1b07
Adapt rax tests to the new unit test framework
knggk Jun 27, 2024
6cf1d96
s/rax->alloc/rax->alloc_size/
knggk Jun 27, 2024
11a5a4f
Tentative fix for address sanitizer
knggk Jun 28, 2024
da095ac
Fix missing zfree for src/valkey-unit-tests --large-memory
knggk Jun 28, 2024
581fdbe
Reduce scope of variable
knggk Jul 3, 2024
a254c28
s/rax_alloc_size/rax_ptr_alloc_size/
knggk Jul 5, 2024
59169c0
Demo checking rax size vs allocator
knggk Jul 9, 2024
540d2cf
More testing of raxAllocSize against the allocator's number
knggk Jul 9, 2024
212ac68
Update some checks into asserts with the new framework
knggk Jul 9, 2024
9f94fdb
Fix confusion that led to test failing
knggk Jul 10, 2024
5f903fe
Apply clang-format
knggk Jul 10, 2024
ea3e33c
Attempt at fixing spellcheck
knggk Jul 10, 2024
f25969b
Update src/unit/test_rax.c
knggk Jul 11, 2024
93b6b57
Add rax into test names for better visualization
knggk Jul 12, 2024
b2c3383
Plug raxAllocSize to mem reporting spots
knggk Jul 12, 2024
7a889ae
Merge remote-tracking branch 'origin/unstable' into rax-size-tracking
knggk Jul 12, 2024
eed12f2
Merge remote-tracking branch 'origin/unstable' into rax-size-tracking
knggk Jul 22, 2024
6b72c68
Merge remote-tracking branch 'origin/unstable' into rax-size-tracking
knggk Oct 1, 2024
fee849d
Fix formatting
knggk Oct 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/rax.c
Original file line number Diff line number Diff line change
Expand Up @@ -1053,8 +1053,8 @@ int raxRemove(rax *rax, unsigned char *s, size_t len, void **old) {
}
if (child) {
debugf("Unlinking child %p from parent %p\n", (void *)child, (void *)h);
raxNode *new = raxRemoveChild(h, child);
size_t oldalloc = rax_alloc_size(h);
raxNode *new = raxRemoveChild(h, child);
zuiderkwast marked this conversation as resolved.
Show resolved Hide resolved
rax->alloc_size = rax->alloc_size - oldalloc + rax_alloc_size(new);
if (new != h) {
raxNode *parent = raxStackPeek(&ts);
Expand Down