dale a �crit dans le message : dale-D70BFC.16062031052000@news.rmit.edu.au... > A discussion at work left me claiming that stack based allocation > was quicker than heap based allocation. > > A person wrote up a demonstration program that proved that this > wasn't the case (at least for the experiment). > [...] > for i in 0 .. N - 1 loop > declare > a : ints_Ptr := new ints; > > begin > for j in a'range loop > a(j) := j; > end loop; > > free (a); > end; > end loop; > end; > A wild guess: Note that in this example, you immediately reallocate an array of the same size that has just been deallocated. This means that the lookup which is often cause of slow heap allocation will immediately find a perfect fit. This is certainly not representative of a real program. Try running your test with random array sizes, then tell us the results... -- --------------------------------------------------------- J-P. Rosen (Rosen.Adalog@wanadoo.fr) Visit Adalog's web site at http://pro.wanadoo.fr/adalog