The cc65 doc explicitly states that the return value of _heapmaxavail() can be used as parameter of malloc(). To actually allow for that the size of HEAP_ADMIN_SPACE has to be substracted from the raw size of the largest free heap block.
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