Move FreeListBlock internal into source

This commit is contained in:
Imbus 2025-09-08 08:48:34 +02:00
parent 682901cafd
commit de6aee3a3a
2 changed files with 9 additions and 7 deletions

View file

@ -6,6 +6,10 @@
#include <stdlib.h>
#include <string.h>
struct FreeListBlock {
struct FreeListBlock *next;
};
/* Initialize the FreeList */
int fl_init(FreeList *fl, uintptr_t start, uintptr_t end, size_t itemsize) {
size_t size = ALIGN(itemsize);

View file

@ -18,16 +18,14 @@ static inline size_t align_up(size_t n) {
#define ALIGN(x) (align_up(x))
#endif // FREELIST_NOALIGN
typedef struct FreeListBlock {
struct FreeListBlock *next;
} FreeListBlock;
typedef struct FreeListBlock FreeListBlock;
typedef struct {
uintptr_t start;
uintptr_t end;
uintptr_t start;
uintptr_t end;
FreeListBlock *free;
size_t size;
size_t allocated;
size_t size;
size_t allocated;
} FreeList;
int fl_init(FreeList *fl, uintptr_t start, uintptr_t end, size_t itemsize);