[fpc-devel] Array of Ansistring

Marco van de Voort marcov at stack.nl
Mon Mar 12 08:48:28 CET 2007


> Making all the 100 ansistrings in this example set to empty doesn't
> Cut it, nor does trying to perform SetLength(MyArray,0);

Both are ok.
 
> At least not when I run tests and look at memory in use in the Win32
> Task Manager in XP.

That is your problem. To optimize performance, nearly all memory allocators
allocate memory from the OS in larger blocks, and then suballocate them.
 
> Or is this simply not a good way to code.

It might not be good if you are going to stuff hundred thousands of them in
an array. A few thousand till 30k-100k is no problem.





More information about the fpc-devel mailing list