mirror of
https://github.com/aaru-dps/libaaruformat.git
synced 2026-04-05 21:51:03 +00:00
Replace string-keyed uthash lookups with HASH_FIND/HASH_ADD on native uint64_t keys. This eliminates per-lookup malloc/snprintf/strlen/free overhead from the block cache hot path (2 lookups per sector read). Before: malloc(17) + snprintf hex + HASH_FIND_STR + free per lookup After: HASH_FIND with 8-byte integer key, zero allocations Also removes the unused string-key API (find_in_cache/add_to_cache) and the uint64_to_string helper — all callers use uint64 keys. Fix off-by-one in eviction: >= caused cache to hold max_items-1 entries instead of max_items. Changed to > so the configured capacity is honored exactly.