[fpc-pascal] Management operators question
Ryan Joseph
ryan at thealchemistguild.com
Fri May 25 17:16:36 CEST 2018
> On May 25, 2018, at 7:03 PM, Maciej Izak <hnb.code at gmail.com> wrote:
>
> all is balanced :) you forgot to handle operator :
>
> class operator Copy(constref src: TDynArray<T>; var dest: TDynArray<T>);
>
> and
>
> class operator AddRef(var a: TDynArray<T>);
>
> for the line from example "d := TIntArray.Create([1, 2, 3]);" the "Copy" operator is executed (you need to check when which operator is used - this is the best way to learn, on the beginning it may looks a bit complicated): so for each AddRef, Copy and Initialization the Finalization operator is executed.
>
> anyway you should not use management operators in FPC trunk, the work is discontinued on the trunk and may be removed (not my fault - for one person in FPC core with admin rights, emotional personal revenge and victimization is more important than work and future of Pascal).
So I need to keep a ref count in the record to balance the calls? I think I get what you’re saying but I’ll try it tomorrow.
I have no idea what’s happening with this drama but hopefully it cools down so you don’t have to remove features or abandon work. Personally I think they’re a great feature and have lots of potential.
Regards,
Ryan Joseph
More information about the fpc-pascal
mailing list