SDCC and malloc() - allocating much less memory than is available
- by Duncan Bayne
When I run compile this code with SDCC 3.1.0, and run it on an Amstrad CPC 464 (under emulation, with WinCPC 0.9.26 running on Wine):
void _test_malloc()
{
long idx = 0;
while (1)
{
if (malloc(5))
{
printf("%ld\r\n", ++idx);
}
else
{
printf("done");
break;
}
}
}
... it consistently taps out…