From 718bf82f966e6963fc214792e36be38d4bb47bc2 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Mon, 27 Aug 2018 09:29:14 -0400 Subject: [PATCH] add inline hints for slab_allocate and slab_free --- malloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/malloc.c b/malloc.c index db7d35c..fec5901 100644 --- a/malloc.c +++ b/malloc.c @@ -303,7 +303,7 @@ static void *slot_pointer(size_t size, void *slab, size_t slot) { return (char *)slab + slot * size; } -static void *slab_allocate(size_t requested_size) { +static inline void *slab_allocate(size_t requested_size) { struct size_info info = get_size_info(requested_size); size_t size = info.size; struct size_class *c = &size_class_metadata[info.class]; @@ -386,7 +386,7 @@ static size_t slab_usable_size(void *p) { return size_classes[slab_size_class(p)]; } -static void slab_free(void *p) { +static inline void slab_free(void *p) { size_t class = slab_size_class(p); struct size_class *c = &size_class_metadata[class];