Skip to content

Commit

Permalink
software: use gnu99 standard for GCC and revert liballoc changes
Browse files Browse the repository at this point in the history
enjoy-digital committed Mar 5, 2016
1 parent 0f14dbe commit 78ce2d6
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion misoc/software/common.mak
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ ifeq ($(CLANG),1)
CC_normal := clang -target $(TRIPLE) -integrated-as
CX_normal := clang++ -target $(TRIPLE) -integrated-as
else
CC_normal := $(TARGET_PREFIX)gcc
CC_normal := $(TARGET_PREFIX)gcc -std=gnu99
CX_normal := $(TARGET_PREFIX)g++
endif
AR_normal := $(TARGET_PREFIX)ar
6 changes: 2 additions & 4 deletions misoc/software/liballoc/alloc.c
Original file line number Diff line number Diff line change
@@ -20,10 +20,9 @@ static struct meta *root;

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

for(list = root; list; list = list->next) {
for(struct meta *list = root; list; list = list->next) {
if(list->magi == BUSY) {
continue;
} else if(list->magi == IDLE) {
@@ -119,12 +118,11 @@ 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(list = root; list; list = list->next) {
for(struct meta *list = root; list; list = list->next) {
meta += sizeof(struct meta);

const char *magi;

0 comments on commit 78ce2d6

Please sign in to comment.