[fpc-pascal]Issues regarding available memory
cubrewer at yahoo.com
Sat May 17 15:39:09 CEST 2003
--- Alan Mead <cubrewer at yahoo.com> wrote:
> Are these globals documented somewhere (I've printed
> all four PDF manuals and I don't recall seeing these) or do I need
> unpack the system unit source to browse them?
My mistake. I see that ReturnNilIfGrowHeapFails is described clearly
on Page 77 of the Programmer's manual. And I see that I've left off
the ending 's'. Now my program compiles.
However, it still doesn't have the behavior I expect (see below).
BTW, note also that even when using the same 1.0.6 version of FPC, I
get RTE 216 on Linux and 203 on Windows 2000.
[amead at alan ian]$ ./dummy
Total heap available is 262128 bytes
Largest block available is 262128 bytes
getmem() was successful
..[lots of periods] ..OK
Runtime error 216 at 0x0804F2B9
[amead at alan ian]$ cat dummy.pas
matrix_element = array[1..1] of byte;
big_matrix = array[1..1000000,1..610] of matrix_element;
longarray = array[0..0] of real;
a : big_matrix;}
l : ^longarray;
size, storage : longint;
writeln('Total heap available is ',MemAvail,' bytes');
writeln('Largest block available is ',MaxAvail,' bytes');
done := false;
size := 40000000;
size := round(size * 1.1);
storage := size * sizeof(real);
if (l=nil) then
done := true;
writeln('getmem() was successful');
j := 0;
for i := 1 to size do
if (j MOD 100000 = 0) then
j := 0;
l^[i] := 1.0;
A Congressman was once asked about his attitude toward whiskey. "If you mean the demon drink that poisons the mind, pollutes the body, desecrates family life, and inflames sinners, then I'm against it. "
"But if you mean the elixir of Christmas cheer, the shield against winter chill, the taxable potion that puts needed funds into public coffers to comfort little crippled children, then I'm for it."
"This is my position, and I will not compromise."
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
More information about the fpc-pascal