When converting from VCL to Firemonkey in Delphi, I have the following issue: In VCL I have the following array: Tcarray=array[1..$04000000] of Tcoordinate; - This works fine.
However, declaring the same array in Firemonkey I get an exception about stack overflow at 0x00.. My only solution so far is to minimize the array to [1..40000].
Why is this? Any solution?
The VCL code is as follow
unit ptypes;
interface
uses windows,vcl.Graphics,Vcl.Imaging.jpeg,Vcl.Imaging.GIFImg,system.Types;
type
Tcoordinate=packed record
x,y:double;
end;
Tcarray=array[1..$04000000] of Tcoordinate;
Tpoly=packed record
n:longint;
c:Tcarray;
end;
It will be called like this:
procedure TForm12.Button2Click(Sender: TObject);
var
poly:Tpoly;
begin
with poly do
begin
c[1].x:=100; c[1].y:=100;
c[2].x:=400; c[2].y:=100;
c[3].x:=400; c[3].y:=400;
c[4].x:=250; c[4].y:=550;
c[5].x:=100; c[5].y:=400;
n:=5;
end;
This works fine in VCL but in FM it breaks with the following error: "Project FMtest.exe raised exception class $C00000FD with message 'stack overflow at 0x00af69e7'.