Hallo
der Stack Overflow wird zur Laufzeit erzeugt. Die Ursache sind aber keine Rekursionen sondern die Arrays. Ich benutze einige DLLs denen man Arrays mit übergeben muss. Diese Arrays sind aber so gross, dass es sofort zum Overflow kommen würde. Das ganze sieht so aus:
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64:
| mmax=1000; nnxest=50; nnyest=50; LLWRK=(7*(NNXEST-4)*(NNYEST-4)+25*(NNXEST-4))*(NNXEST-3)+2*((NNXEST-4)+(NNYEST-4)+4*MMAX)+ 100+23*(NNXEST-4)+56; LLIWRK=MMAX+2*(NNXEST-7)*(NNYEST-7)+10;
type
TForm1 = class(TForm) .... private { Private-Deklarationen } public { Public-Deklarationen } end;
double_mmax = array[1..mmax] of double; double_lamda = array[1..NnXEST] of double; double_mu = array[1..NnYEST] of double; double_c = array[1..((NnXEST-4)*(NnXEST-4))] of double; double_lwrk = array[1..LLWRK] of double; integer_liwrk = array[1..LLIWRK] of integer;
double_xmx = array[1..1] of double; double_ymy = array[1..1] of double; double_fg = array[1..1] of double;
Func_PHI1 = function(Var Y:double):double;stdcall; Func_PHI2 = function(Var Y:double):double;stdcall; Func_F = function(Var X:double;Var Y:double):double;stdcall;
var
Form1 : TForm1;
xmax2 : double; xmin2 : double; ymax2 : double; ymin2 : double; zmin2 : double; zmax2 : double;
xmax1 : double; xmin1 : double; ymax1 : double; ymin1 : double; zmin1 : double; zmax1 : double;
lamda2 : double_lamda; lamda1 : double_lamda; mu1 : double_mu; mu2 : double_mu; c2 : double_c; c1 : double_c;
x2 : integer; x1 : integer; y2 : integer; y1 : integer; |
Den Array benutze ich dann in einer Prozedur mit:
Quelltext
1: 2: 3: 4: 5: 6:
| lx : double_mmax; ly : double_mmax; lz : double_mmax; lw : double_mmax; work : double_lwrk; iwork : integer_liwrk; |
Hier kommt es dann zur Laufzeit zum Overflow. Ich habe den $M Befehl benutzt und das funktioniert auch meistens. Nur ab und wann kommt der Overflow. Mach ich da was falsch ?
Gruss
Markus