mirror of
https://codeberg.org/andyscott/marCsweep.git
synced 2024-12-22 01:33:11 -05:00
malloc: hide
and magic
are static
This commit is contained in:
parent
00f62da35c
commit
f80156344b
2 changed files with 2 additions and 8 deletions
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue