Hi Frank,
thanks for the hints: another question, is there a way of using run-gpc in a parallel environment, i.e. with mpi? In this case one runs programs by means of the script mpirun, but I see no way of using both at the same time... so maybe there's a compiler directive to give more verbose error messages, in order for one to be able to spot the errors without manually dissecting the code?
Silvio
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.
what does in this context mean "range check error"?
The same as in other contexts: A value is out of range. 130 * 255 * 255 * 255 is bigger than what a 32 bit signed integer can hold (2^31 - 1).
Sometimes I get the same error when using dynamic arrays, usually when bounds are trespassed. Is there a way to know at which code line the error generates,
addr2line and run-gpc (you can search the archives for details).
and does the error have consequences on the results of the code?
Sure, it aborts. ;-)
If you disable range-checking, you get undefined behaviour. This can be anything from apparently correct operation, to minor or not so minor errors (wrap-around), to serious errors (memory trashing), to segfaults ...
Frank
--
Email.it, the professional e-mail, gratis per te: http://www.email.it/f
Sponsor:
Migliaia di manuali e guide scaricabili su: Hacker, Reti, Webmaster, Windows e non solo...clicca qui
Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=3412&d=26-7