[fpc-pascal] Dynamic arrays using management operators
Ryan Joseph
ryan at thealchemistguild.com
Mon Jun 4 14:30:19 CEST 2018
> On Jun 4, 2018, at 5:46 PM, Michael Van Canneyt <michael at freepascal.org> wrote:
>
> Well, as far as I can see, you are repeating what the compiler already does for you out of the box.
But it’s customizable, that’s the point. What happens when you remove an element from a dynamic array? I don’t even know where to look in the source code to find out and if I want to change something I can’t. Do dynamic arrays resize memory when you remove elements? Maybe I don’t want that. Maybe I want to grow the array at different intervals, can’t do that either.
I know this is very fringe but I personally needed to customize dynamic arrays to escape that thread safety thing and when I couldn’t I had to make my own array wrapper class which I would have preferred to be a record in many instances, which I can do now. If nothing else it saves me lots of Create/Free calls in countless functions. Pretty good news.
If I actually made a competent implementation (which I’ll do later) dynamic arrays are possibly made redundant even, or close to it (providing the FPC RTL had something like them included).
Regards,
Ryan Joseph
More information about the fpc-pascal
mailing list