Skip to content

Commit

Permalink
software/liballoc: avoid C99
Browse files Browse the repository at this point in the history
enjoy-digital committed Mar 4, 2016
1 parent 74a5525 commit 7aaec80
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions misoc/software/liballoc/alloc.c
Original file line number Diff line number Diff line change
@@ -20,9 +20,10 @@ static struct meta *root;

void *malloc(size_t size)
{
struct meta *list;
size += FILL - (size % FILL); /* round up */

for(struct meta *list = root; list; list = list->next) {
for(list = root; list; list = list->next) {
if(list->magi == BUSY) {
continue;
} else if(list->magi == IDLE) {
@@ -118,11 +119,12 @@ void alloc_give(void *area, size_t size)

void alloc_show()
{
struct meta *list;
size_t busy = 0, idle = 0, meta = 0;

printf("Heap view:\n");

for(struct meta *list = root; list; list = list->next) {
for(list = root; list; list = list->next) {
meta += sizeof(struct meta);

const char *magi;

0 comments on commit 7aaec80

Please sign in to comment.