mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-09 20:28:49 +02:00
* added error checking to the test
git-svn-id: trunk@42730 -
This commit is contained in:
parent
693e72ade3
commit
27a4a3d446
@ -2,6 +2,7 @@ var
|
||||
a : array[0..3] of pointer;
|
||||
i,j : longint;
|
||||
HeapStatus : THeapStatus;
|
||||
oldmemsize: ptruint;
|
||||
begin
|
||||
randomize;
|
||||
{$if not(defined(CPU8)) and not(defined(CPU16))}
|
||||
@ -11,7 +12,16 @@ begin
|
||||
if not(assigned(a[j])) then
|
||||
getmem(a[j],1024*1024)
|
||||
else
|
||||
reallocmem(a[j],MemSize(a[j])*11 div 10);
|
||||
begin
|
||||
oldmemsize:=MemSize(a[j]);
|
||||
reallocmem(a[j],oldmemsize*11 div 10);
|
||||
if pbyte(a[j])^<>123 then
|
||||
halt(1);
|
||||
if (pbyte(a[j])+oldmemsize-1)^<>231 then
|
||||
halt(2);
|
||||
end;
|
||||
pbyte(a[j])^:=123;
|
||||
pbyte(a[j]+memsize(a[j])-1)^:=231;
|
||||
end;
|
||||
for i:=0 to high(a) do
|
||||
freemem(a[i]);
|
||||
|
Loading…
Reference in New Issue
Block a user