Is there a coreleft() function in alloc.h?
Is there a coreleft() function in alloc.h?
Is there a coreleft() function in alloc.h? or something similar? I'd like to see how much memory is available when loading a CP/M program.
Thanks, I am trying:
main.c:9: warning 112: function 'mallinfo' implicit declaration
main.c:9: error 101: too many parameters
Code: Select all
#include <stdio.h>
#include <stdarg.h>
#include <alloc.h>
int main()
{
unsigned int total,largest;
mallinfo(&total,&largest);
printf("%u %u\n",total,largest);
return 0;
}
main.c:9: error 101: too many parameters
Ah. I didn't realise you were using newlib. It looks like you can use heap_info(_malloc_heap, <callback_function>) and walk the blocks to determine usage.
Given your other problem (fopen not working), it's probably worth switching to classic (drop the -clib= option) to get the features you want.
Originally, the classic library and new library were completely different code bases, however over time they have converged with the result that the only differences are as follows:
* Classic supports many more targets and has different way of implementing the crt0 startup file
* <stdio.h> is a different implementation that supports file io
* Classic supports multiple floating point libraries for pure sccz80 compilations
* Classic provides the cross platform libraries detailed below
* Classic tends to be tuned at link time, newlib at library build time
Given your other problem (fopen not working), it's probably worth switching to classic (drop the -clib= option) to get the features you want.
Originally, the classic library and new library were completely different code bases, however over time they have converged with the result that the only differences are as follows:
* Classic supports many more targets and has different way of implementing the crt0 startup file
* <stdio.h> is a different implementation that supports file io
* Classic supports multiple floating point libraries for pure sccz80 compilations
* Classic provides the cross platform libraries detailed below
* Classic tends to be tuned at link time, newlib at library build time