use @bitsizeof()

This commit is contained in:
Alessandro Mauri 2026-03-20 18:21:37 +01:00
parent bafadae1e0
commit 14e0a6ad0a

View File

@ -96,8 +96,7 @@ fn void Cache.remove(&cache, Key id)
/* If there is no free space left then just return the first position */
fn usz Cache.get_free_spot(&cache)
{
// TODO: in the upgrade to c3 1.7.5 use @bitsof()
const BITS = $typeof(cache.present.data[0]).sizeof*8;
const BITS = @bitsizeof(cache.present.data[0]);
foreach (idx, d: cache.present.data) {
if (d != $typeof(d).max) {
usz spot = idx*BITS + BITS-d.clz();