From: Simon Kuenzer Date: Thu, 12 Nov 2020 15:54:50 +0000 (+0100) Subject: lib/ukallocregion: Internal functions as `static` X-Git-Tag: RELEASE-0.6~169 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=59dad8c1ca356d72eb054b096e35ed54852cc506;p=unikraft%2Funikraft.git lib/ukallocregion: Internal functions as `static` Declares internal functions as static in order to enable potentially more aggressive optimizations by the compiler. Signed-off-by: Simon Kuenzer Reviewed-by: Cezar Craciunoiu Tested-by: Unikraft CI GitHub-Pull-Request: #229 --- diff --git a/lib/ukallocregion/region.c b/lib/ukallocregion/region.c index 54b2276e1..af40bf5d0 100644 --- a/lib/ukallocregion/region.c +++ b/lib/ukallocregion/region.c @@ -56,7 +56,7 @@ struct uk_allocregion { void *heap_base; }; -void *uk_allocregion_malloc(struct uk_alloc *a, size_t size) +static void *uk_allocregion_malloc(struct uk_alloc *a, size_t size) { struct uk_allocregion *b; uintptr_t intptr, newbase; @@ -86,8 +86,8 @@ void *uk_allocregion_malloc(struct uk_alloc *a, size_t size) return (void *) intptr; } -int uk_allocregion_posix_memalign(struct uk_alloc *a, void **memptr, - size_t align, size_t size) +static int uk_allocregion_posix_memalign(struct uk_alloc *a, void **memptr, + size_t align, size_t size) { struct uk_allocregion *b; uintptr_t intptr, newbase; @@ -125,7 +125,8 @@ int uk_allocregion_posix_memalign(struct uk_alloc *a, void **memptr, return 0; } -void uk_allocregion_free(struct uk_alloc *a __unused, void *ptr __unused) +static void uk_allocregion_free(struct uk_alloc *a __maybe_unused, + void *ptr __maybe_unused) { uk_pr_debug("%p: Releasing of memory is not supported by " "ukallocregion\n", a); @@ -147,8 +148,8 @@ static ssize_t uk_allocregion_leftspace(struct uk_alloc *a) return (uintptr_t) b->heap_top - (uintptr_t) b->heap_base; } -int uk_allocregion_addmem(struct uk_alloc *a __unused, void *base __unused, - size_t size __unused) +static int uk_allocregion_addmem(struct uk_alloc *a __unused, + void *base __unused, size_t size __unused) { /* TODO: support multiple regions */ uk_pr_debug("%p: ukallocregion does not support multiple memory "