malloc: hide and magic are static

This commit is contained in:
Andrew Scott 2024-09-18 01:20:01 -04:00
parent 00f62da35c
commit f80156344b
Signed by: a
GPG key ID: 7CD5A5977E4931C1
2 changed files with 2 additions and 8 deletions

View file

@ -30,12 +30,6 @@ struct gc_chunk {
struct gc_chunk *prev; 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 // Performs allocations of SIZE bytes
void *gc_malloc(size_t size); void *gc_malloc(size_t size);

View file

@ -4,13 +4,13 @@
#include "gc_malloc.h" #include "gc_malloc.h"
// Hides chunk header // Hides chunk header
inline void *hide(struct gc_chunk *curr) static inline void *hide(struct gc_chunk *curr)
{ {
return (void *)((uint64_t *)curr + MAGIC); return (void *)((uint64_t *)curr + MAGIC);
} }
// Reveals chunk header // 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); return (struct gc_chunk *)((uint64_t *)mem - MAGIC);
} }