On Mon, 25 Jul 2005, Frank Heckenbach wrote:
Silvio a Beccara wrote:
thanks for the hints. I tried to compile and run your program, and I get a very similar result:
[...] allocated 2105834625 bytes allocated 2122416000 bytes allocated 2138997375 bytes ./heaptest: value out of range (error #300 at 8049dbc)
That's no memory allocation error, but a range-check error. The computed size (next would be 130 * 255 * 255 * 255) doesn't fit in a 32 bit signed integer anymore. If you want to allocate more than 2 GB in a single allocation (which was not your original request), you could try to use an unsigned type (Cardinal or perhaps better SizeType). However, I've never tested this, so there may be RTS or libc issues.
It's an RTS issue. From error.pas:
procedure RuntimeErrorInteger (n: Integer; i: MedInt); begin SetReturnAddress (ReturnAddress (0)); ErrorMessageString := FormatStr (GetErrorMessage (n), Integer2String (i)); EndRuntimeError (n) end;
On my box "heaptest" quit at less then max MedInt so I got the expected error message:
heaptest: out of heap when allocating 2039509125 bytes (error #853 at 8049e61)
Russ