Skip to content

Commit

Permalink
lib/kru: improve code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukáš Ondráček committed Oct 31, 2024
1 parent 5a1c870 commit 94cafb8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/kru.inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ struct kru {
struct load_cl load_cls[][TABLE_COUNT];
};

inline static uint64_t rand_bits(unsigned int bits) {
inline static uint64_t rand_bits(unsigned int bits)
{
static _Thread_local uint64_t state = 3723796604792068981ull;
const uint64_t prime1 = 11737314301796036329ull;
const uint64_t prime2 = 3107264277052274849ull;
Expand All @@ -137,7 +138,7 @@ static inline void update_time(struct load_cl *l, const uint32_t time_now,
const struct decay_config *decay)
{
uint32_t ticks;
uint32_t time_last = atomic_load_explicit(&l->time,memory_order_relaxed);
uint32_t time_last = atomic_load_explicit(&l->time, memory_order_relaxed);
do {
ticks = time_now - time_last;
if (__builtin_expect(!ticks, true)) // we optimize for time not advancing
Expand Down Expand Up @@ -272,7 +273,6 @@ static inline void kru_limited_prefetch(struct kru *kru, uint32_t time_now, uint
ctx->id = hash;
}


/// Phase 1/3 of a query -- hash, prefetch, ctx init. Based on a bit prefix of one 16-byte key.
static inline void kru_limited_prefetch_prefix(struct kru *kru, uint32_t time_now, uint8_t namespace, uint8_t key[static 16], uint8_t prefix, kru_price_t price, struct query_ctx *ctx)
{
Expand Down

0 comments on commit 94cafb8

Please sign in to comment.