From b8f3a2da8c460e6d5c57b78e322198bc01bd234d Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 11 Jul 2020 14:07:20 -0700 Subject: [PATCH] expose bestalloc, bestfree, bestresize to other parts of vmalloc --- lib/vmalloc/vmbest.c | 6 +++--- lib/vmalloc/vmhdr.h | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/vmalloc/vmbest.c b/lib/vmalloc/vmbest.c index b8aeb441a..dab3fe55a 100644 --- a/lib/vmalloc/vmbest.c +++ b/lib/vmalloc/vmbest.c @@ -43,7 +43,7 @@ static bool make_space(Vmdata_t *vd) { * @param vm region allocating from * @param size desired block size */ -static void *bestalloc(Vmalloc_t *vm, size_t size) { +void *bestalloc(Vmalloc_t *vm, size_t size) { Vmdata_t *vd = vm->data; void *p; @@ -62,7 +62,7 @@ static void *bestalloc(Vmalloc_t *vm, size_t size) { return p; } -static int bestfree(Vmalloc_t *vm, void *data) { +int bestfree(Vmalloc_t *vm, void *data) { Vmdata_t *vd = vm->data; size_t i; @@ -96,7 +96,7 @@ static int bestfree(Vmalloc_t *vm, void *data) { * @param size new size * @param type ignored */ -static void *bestresize(Vmalloc_t *vm, void *data, size_t size, int type) { +void *bestresize(Vmalloc_t *vm, void *data, size_t size, int type) { Vmdata_t *vd = vm->data; size_t i; diff --git a/lib/vmalloc/vmhdr.h b/lib/vmalloc/vmhdr.h index f7e0c3bd5..94ab9f756 100644 --- a/lib/vmalloc/vmhdr.h +++ b/lib/vmalloc/vmhdr.h @@ -416,6 +416,10 @@ extern "C" { extern Vmuchar_t *sbrk(ssize_t); #endif +void *bestalloc(Vmalloc_t * vm, size_t size); +int bestfree(Vmalloc_t * vm, void * data); +void *bestresize(Vmalloc_t * vm, void * data, size_t size, int type); + #endif /* _VMHDR_H */ #ifdef __cplusplus } -- 2.40.0