[fpc-pascal] Dynamic arrays using management operators

Ryan Joseph ryan at thealchemistguild.com
Mon Jun 4 16:41:55 CEST 2018


> On Jun 4, 2018, at 9:12 PM, Michael Van Canneyt <michael at freepascal.org> wrote:
> 
> All the rest of what you do remains exactly the same. Dynamic arrays do far less than what you seem to assume.

As noted the inclocked()/declocked() calls destroyed some performance sensitive parts of my code while testing and I had a choice to try to figure out the FPC or sources or just replace the dynamic arrays with my own memory management (totally trivial anyways). The dynamic arrays where inside of a class which I had to make anyways so I could extend the dynamic arrays to have append operations and optionally not resize memory when removing elements (I don’t know if dynamic arrays do that or not, who knows). I wish I kept the old performance profiles so we could look at them again.

It’s so trivial to make a class wrapper around simple memory management like arrays I felt like it was strange to use a hidden implementation that I couldn’t control 100%. It feels like RTL kind of stuff.

Regards,
	Ryan Joseph




More information about the fpc-pascal mailing list