63 |
static u8_t ram[MEM_SIZE + sizeof(struct mem) + MEM_ALIGNMENT]; |
static u8_t ram[MEM_SIZE + sizeof(struct mem) + MEM_ALIGNMENT]; |
64 |
|
|
65 |
#define MIN_SIZE 12 |
#define MIN_SIZE 12 |
66 |
#define SIZEOF_STRUCT_MEM MEM_ALIGN_SIZE(sizeof(struct mem)) |
#if 0 /* this one does not align correctly for some, resulting in crashes */ |
67 |
/*#define SIZEOF_STRUCT_MEM (sizeof(struct mem) + \ |
#define SIZEOF_STRUCT_MEM (unsigned int)MEM_ALIGN_SIZE(sizeof(struct mem)) |
68 |
|
#else |
69 |
|
#define SIZEOF_STRUCT_MEM (sizeof(struct mem) + \ |
70 |
(((sizeof(struct mem) % MEM_ALIGNMENT) == 0)? 0 : \ |
(((sizeof(struct mem) % MEM_ALIGNMENT) == 0)? 0 : \ |
71 |
(4 - (sizeof(struct mem) % MEM_ALIGNMENT))))*/ |
(4 - (sizeof(struct mem) % MEM_ALIGNMENT)))) |
72 |
|
#endif |
73 |
|
|
74 |
static struct mem *lfree; /* pointer to the lowest free block */ |
static struct mem *lfree; /* pointer to the lowest free block */ |
75 |
|
|