Fixed bug in heap manager - forgot to initialise freeptr

This commit is contained in:
Adam Greenwood-Byrne 2021-03-09 22:16:25 +00:00
parent a5fdf22a1d
commit 0c55d05177
2 changed files with 35 additions and 31 deletions

View file

@ -1,4 +1,5 @@
#include "wgt.h"
#include "include/mem.h"
// ######## REQUIRED FUNCTIONS ########
@ -53,6 +54,7 @@ void wgt08()
{
short x;
mem_init();
vga256 ();
wcls (vgapal[0]);

View file

@ -19,6 +19,8 @@ void mem_init()
HEAP_START += 8 - ((long)&HEAP_START % 8);
}
HEAP_END = (unsigned char *)(HEAP_START + HEAP_SIZE);
freeptr = HEAP_START;
}
void *malloc(unsigned int size)