/// but there was no need to remove the (possibly expired) entry from the cache.
#pragma once
+#include <stdalign.h>
#include "lib/mmapped.h"
-#include "lib/kru.h"
/// Data related to open cache.
struct kr_cache_top {
uint32_t version;
uint32_t base_price_norm;
uint32_t max_decay;
- _Alignas(64) uint8_t kru[];
+ alignas(64) uint8_t kru[];
};
/// Part of kr_request to avoid counting repeated cache accesses multiple times during single request.
}
/// Price of a cache entry access in KRU based on the entry size.
-static inline kru_price_t kr_cache_top_entry_price(struct kr_cache_top *top, size_t size) {
+static inline uint32_t kr_cache_top_entry_price(struct kr_cache_top *top, size_t size) {
return top->data->base_price_norm / size;
}
#include <libknot/libknot.h>
#include "lib/utils.h"
#include "lib/cache/top.h"
+#include "lib/kru.h"
#include "utils/cache_gc/db.h"
static inline int load2cat(uint16_t load) // -> 0..64, reversed