Frank Heckenbach wrote:
CBFalconer wrote:
Adriaan van Os wrote:
... snip ...
TEST fjf31.pas: failed: 2, 2, 1
TEST pack1.pas: failed
TEST systemtest.pas: *** malloc: vm_allocate(size=2147483648) failed
Of course it did. malloc of that size would require a sbrk with a negative size (even though sbrk is specified to take an unsigned). That would reduce the heap space available, and create havoc.
Yes, it will fail, but it should return a nil pointer then, rather than aborting the program and writing an error on its own. AFAIK, that's the required behaviour in standard C (which makes sense -- imagine an interactive program or a long calculation just aborted, without giving the programmer any chance to clean up). And that's just what this test tests.
Then he should try my nmalloc, as I posted earlier. That's just what it will do.