Compare commits
No commits in common. "de6aee3a3a9fc113d6bac4c8cd31b431fad02e8c" and "3d4fe51dd1c1065050dafe4047b54fa34efa21f8" have entirely different histories.
de6aee3a3a
...
3d4fe51dd1
2 changed files with 10 additions and 9 deletions
|
|
@ -6,10 +6,6 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
struct FreeListBlock {
|
|
||||||
struct FreeListBlock *next;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Initialize the FreeList */
|
/* Initialize the FreeList */
|
||||||
int fl_init(FreeList *fl, uintptr_t start, uintptr_t end, size_t itemsize) {
|
int fl_init(FreeList *fl, uintptr_t start, uintptr_t end, size_t itemsize) {
|
||||||
size_t size = ALIGN(itemsize);
|
size_t size = ALIGN(itemsize);
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,12 @@ static inline size_t align_up(size_t n) {
|
||||||
#define ALIGN(x) (align_up(x))
|
#define ALIGN(x) (align_up(x))
|
||||||
#endif // FREELIST_NOALIGN
|
#endif // FREELIST_NOALIGN
|
||||||
|
|
||||||
typedef struct FreeListBlock FreeListBlock;
|
#define FL_FREE ((uint8_t)0x00)
|
||||||
|
#define FL_USED ((uint8_t)0x01)
|
||||||
|
|
||||||
|
typedef struct FreeListBlock {
|
||||||
|
struct FreeListBlock *next;
|
||||||
|
} FreeListBlock;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uintptr_t start;
|
uintptr_t start;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue