From f80156344b269cf1824312075d574428f3123ea7 Mon Sep 17 00:00:00 2001 From: Andrew Scott Date: Wed, 18 Sep 2024 01:20:01 -0400 Subject: [PATCH] malloc: `hide` and `magic` are static --- include/gc_malloc.h | 6 ------ src/gc_malloc.c | 4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/include/gc_malloc.h b/include/gc_malloc.h index a91637b..cadc528 100644 --- a/include/gc_malloc.h +++ b/include/gc_malloc.h @@ -30,12 +30,6 @@ struct gc_chunk { struct gc_chunk *prev; }; -// Hides chunk header -inline void *hide(struct gc_chunk *curr); - -// Reveals chunk header -inline struct gc_chunk *magic(void *mem); - // Performs allocations of SIZE bytes void *gc_malloc(size_t size); diff --git a/src/gc_malloc.c b/src/gc_malloc.c index 8569ca1..a0c1c31 100644 --- a/src/gc_malloc.c +++ b/src/gc_malloc.c @@ -4,13 +4,13 @@ #include "gc_malloc.h" // Hides chunk header -inline void *hide(struct gc_chunk *curr) +static inline void *hide(struct gc_chunk *curr) { return (void *)((uint64_t *)curr + MAGIC); } // Reveals chunk header -inline struct gc_chunk *magic(void *mem) +static inline struct gc_chunk *magic(void *mem) { return (struct gc_chunk *)((uint64_t *)mem - MAGIC); }