Move _heap.h to the compiler include dir.

Create heap.inc and use that from the assembler code.
Rename heap related _h... variables to _heap...
Add _heapmaxavail and _heapmemavail functions.


git-svn-id: svn://svn.cc65.org/cc65/trunk@1912 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2003-02-01 12:22:09 +00:00
parent 8012074ea0
commit 581c12ce40
11 changed files with 422 additions and 246 deletions

View File

@@ -35,7 +35,7 @@
#include <stdlib.h>
#include <string.h>
#include "_heap.h"
#include <_heap.h>
@@ -73,13 +73,13 @@ void* __fastcall__ realloc (void* block, size_t size)
diff = size - oldsize;
/* Is the block at the current heap top? */
if (((int) b) + oldsize == ((int) _hptr)) {
if (((int) b) + oldsize == ((int) _heapptr)) {
/* Check if we've enough memory at the heap top */
int newhptr;
newhptr = ((int) _hptr) + diff;
if (newhptr <= ((int) _hend)) {
newhptr = ((int) _heapptr) + diff;
if (newhptr <= ((int) _heapend)) {
/* Ok, there's space enough */
_hptr = (unsigned*) newhptr;
_heapptr = (unsigned*) newhptr;
*b = size;
return block;
}
@@ -109,3 +109,4 @@ void* __fastcall__ realloc (void* block, size_t size)