summaryrefslogtreecommitdiff
path: root/src/cache/backings
diff options
context:
space:
mode:
Diffstat (limited to 'src/cache/backings')
-rw-r--r--src/cache/backings/memory.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/cache/backings/memory.c b/src/cache/backings/memory.c
index 063c1c5..ba0bb54 100644
--- a/src/cache/backings/memory.c
+++ b/src/cache/backings/memory.c
@@ -6,7 +6,11 @@ static void ensure_allocated(struct cch_backing_memory *mem, off_t amount)
{
if (amount > mem->expanse) mem->expanse = amount;
if (amount > mem->alloc) {
- mem->alloc = al_next_power_of_two(amount);
+ if (amount < MB(8)) {
+ mem->alloc = al_next_power_of_two(amount);
+ } else {
+ mem->alloc = amount;
+ }
mem->data = (u8 *)al_realloc(mem->data, mem->alloc);
}
}