cache->ttl_max = KR_CACHE_DEFAULT_TTL_MAX;
kr_cache_make_checkpoint(cache);
- char *top_path = kr_absolutize_path(opts->path, "top");
+ const char *top_path = kr_absolutize_path(opts->path, "top");
if (kr_fails_assert(top_path)) {
ret = kr_error(errno);
}
if (ret == 0) {
ret = kr_cache_top_init(&cache->top, top_path, orig_maxsize);
- free(top_path);
+ free_const(top_path);
}
if (ret != 0) {
cache->api->close(cache->db, &cache->stats);
return top_size;
}
-int kr_cache_top_init(struct kr_cache_top *top, char *mmap_file, size_t cache_size)
+int kr_cache_top_init(struct kr_cache_top *top, const char *mmap_file, size_t cache_size)
{
size_t size = 0, capacity_log = 0;
if (cache_size > 0) {
/// If cache_size differs from the previously used value, the data are cleared,
/// otherwise they are persistent across restarts.
KR_EXPORT
-int kr_cache_top_init(struct kr_cache_top *top, char *mmap_file, size_t cache_size);
+int kr_cache_top_init(struct kr_cache_top *top, const char *mmap_file, size_t cache_size);
/// Deinitialize shared memory, keeping the data stored in file.
KR_EXPORT