Dolda2000 GitWeb
/
ashd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f905ca5
)
ratequeue: Improve rehash implementation.
author
Fredrik Tolf
<fredrik@dolda2000.com>
Sat, 31 Aug 2024 14:56:36 +0000
(16:56 +0200)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Sat, 31 Aug 2024 14:56:36 +0000
(16:56 +0200)
src/ratequeue.c
patch
|
blob
|
blame
|
history
diff --git
a/src/ratequeue.c
b/src/ratequeue.c
index
c349f18
..
3d2e6d9
100644
(file)
--- a/
src/ratequeue.c
+++ b/
src/ratequeue.c
@@
-161,12
+161,11
@@
static void rehash(int nlen)
nlen = SBUCKETS;
new = sbuckets;
} else {
- new = s
z
malloc(sizeof(*new) * (1 << nlen));
+ new = smalloc(sizeof(*new) * (1 << nlen));
}
if(nlen == hashlen)
return;
- if(new == sbuckets)
- memset(sbuckets, 0, sizeof(sbuckets));
+ memset(new, 0, sizeof(*new) * (1 << nlen));
assert(old != new);
pl = 1 << hashlen; nl = 1 << nlen; m = nl - 1;
for(i = 0; i < pl; i++) {