From 7d9b6f8a9be22743107bfb2ab4ef552dba24470e Mon Sep 17 00:00:00 2001 From: Aengus McGuinness Date: Wed, 21 Jan 2026 15:31:30 -0500 Subject: [PATCH 1/2] fix(cachesim): prevent malformed tinyLFU params when input is empty --- libCacheSim/bin/cachesim/cache_init.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libCacheSim/bin/cachesim/cache_init.h b/libCacheSim/bin/cachesim/cache_init.h index 94f135ef..9525d657 100644 --- a/libCacheSim/bin/cachesim/cache_init.h +++ b/libCacheSim/bin/cachesim/cache_init.h @@ -103,8 +103,8 @@ static inline cache_t *create_cache(const char *trace_path, cc_params.hashpower = MAX(cc_params.hashpower - 8, 16); cache = Hyperbolic_init(cc_params, eviction_params); } else if (strcasecmp(eviction_algo, "tinyLFU") == 0) { - if (eviction_params == NULL) { - cache = WTinyLFU_init(cc_params, eviction_params); + if (eviction_params == NULL || eviction_params[0] == '\0') { + cache = WTinyLFU_init(cc_params, "window-size=0.01"); } else { const char *window_size = strstr(eviction_params, "window-size="); if (window_size == NULL) { From eaa9d0cecbf1c60782950907a2a595dc17e122d9 Mon Sep 17 00:00:00 2001 From: Aengus McGuinness Date: Wed, 21 Jan 2026 22:11:18 -0500 Subject: [PATCH 2/2] style: remove trailing whitespace and use NULL for default params --- libCacheSim/bin/cachesim/cache_init.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libCacheSim/bin/cachesim/cache_init.h b/libCacheSim/bin/cachesim/cache_init.h index 9525d657..52c7363b 100644 --- a/libCacheSim/bin/cachesim/cache_init.h +++ b/libCacheSim/bin/cachesim/cache_init.h @@ -103,8 +103,8 @@ static inline cache_t *create_cache(const char *trace_path, cc_params.hashpower = MAX(cc_params.hashpower - 8, 16); cache = Hyperbolic_init(cc_params, eviction_params); } else if (strcasecmp(eviction_algo, "tinyLFU") == 0) { - if (eviction_params == NULL || eviction_params[0] == '\0') { - cache = WTinyLFU_init(cc_params, "window-size=0.01"); + if (eviction_params == NULL || eviction_params[0] == '\0') { + cache = WTinyLFU_init(cc_params, NULL); } else { const char *window_size = strstr(eviction_params, "window-size="); if (window_size == NULL) {