mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 06:29:38 +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;
|
a : array[0..3] of pointer;
|
||||||
i,j : longint;
|
i,j : longint;
|
||||||
HeapStatus : THeapStatus;
|
HeapStatus : THeapStatus;
|
||||||
|
oldmemsize: ptruint;
|
||||||
begin
|
begin
|
||||||
randomize;
|
randomize;
|
||||||
{$if not(defined(CPU8)) and not(defined(CPU16))}
|
{$if not(defined(CPU8)) and not(defined(CPU16))}
|
||||||
@ -11,7 +12,16 @@ begin
|
|||||||
if not(assigned(a[j])) then
|
if not(assigned(a[j])) then
|
||||||
getmem(a[j],1024*1024)
|
getmem(a[j],1024*1024)
|
||||||
else
|
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;
|
end;
|
||||||
for i:=0 to high(a) do
|
for i:=0 to high(a) do
|
||||||
freemem(a[i]);
|
freemem(a[i]);
|
||||||
|
Loading…
Reference in New Issue
Block a user