// When "max files" or "max cache size" is reached, one of the 16 cache
// subdirectories is cleaned up. When doing so, files are deleted (in LRU
// order) until the levels are below limit_multiple.
- cache_size_threshold = (uint64_t)round(conf->max_size * limit_multiple / 16);
- files_in_cache_threshold =
- (size_t)round(conf->max_files * limit_multiple / 16);
+ double cache_size_float = round(conf->max_size * limit_multiple / 16);
+ cache_size_threshold = (uint64_t)cache_size_float;
+ double files_in_cache_float = round(conf->max_files * limit_multiple / 16);
+ files_in_cache_threshold = (size_t)files_in_cache_float;
num_files = 0;
cache_size = 0;
h->entrycount = 0;
h->hashfn = hashf;
h->eqfn = eqf;
- h->loadlimit = (unsigned int) ceilf((float) size * max_load_factor);
+ double loadlimit_float = ceil((double)size * (double)max_load_factor);
+ h->loadlimit = (unsigned int)loadlimit_float;
return h;
}
}
}
h->tablelength = newsize;
- h->loadlimit = (unsigned int) ceil(newsize * max_load_factor);
+ double loadlimit_float = ceil((double)newsize* (double)max_load_factor);
+ h->loadlimit = (unsigned int) loadlimit_float;
return -1;
}