diff --git a/include/gcache/ghost_kv_cache.h b/include/gcache/ghost_kv_cache.h index a7bc85c..b1cefd0 100644 --- a/include/gcache/ghost_kv_cache.h +++ b/include/gcache/ghost_kv_cache.h @@ -17,7 +17,7 @@ struct GhostKvMeta { * pair can be variable-length. By default support sampling (non-sampling * version can be acquired by setting SampleShift=0) */ -template , +template class SampledGhostKvCache { SampledGhostCache, SizeType, diff --git a/include/gcache/hash.h b/include/gcache/hash.h index f118615..9215f94 100644 --- a/include/gcache/hash.h +++ b/include/gcache/hash.h @@ -64,4 +64,12 @@ struct murmurhash { uint32_t operator()(uint32_t x) const noexcept { return murmurhash_u32(x); } }; +/* Hash for string_view */ + +struct gshash { // default string hash function for gcache + uint32_t operator()(const std::string_view x) const noexcept { + return crc32_u32(0x537, std::hash{}(x)); + } +}; + } // namespace gcache