From f25d2396759a6461e4adebfc8e0ab0a808d99ecc Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Mon, 30 Jan 2023 20:12:00 -0600 Subject: [PATCH] util/vma: Allow initializing zero-size heaps Part-of: --- src/util/vma.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/util/vma.c b/src/util/vma.c index 3775825..ca96486 100644 --- a/src/util/vma.c +++ b/src/util/vma.c @@ -49,7 +49,8 @@ util_vma_heap_init(struct util_vma_heap *heap, { list_inithead(&heap->holes); heap->free_size = 0; - util_vma_heap_free(heap, start, size); + if (size > 0) + util_vma_heap_free(heap, start, size); /* Default to using high addresses */ heap->alloc_high = true; -- 2.7.4