Re: [fpc-devel] Pascal Smart Pointers Idea + ARC implementation

2016-05-30 Thread Maciej Izak
2015-10-10 21:12 GMT+02:00 Sven Barth : > > "@@" (though I have to admit that I don't know where you got that @@ from; > was that introduced in Delphi recently?)). > > It's not an easy topic and I'd really welcome the input of other core > developers... > Somehow I forgot to answer... @@ is old

Re: [fpc-devel] Pascal Smart Pointers Idea + ARC implementation

2015-10-10 Thread Maciej Izak
2015-10-10 21:12 GMT+02:00 Sven Barth : > It's not an easy topic and I'd really welcome the input of other core > developers... > > Regards, > Sven That would be great. Especially interesting for me is opinion about "default" for field (IMO better than introducing many new operators). Maybe it i

Re: [fpc-devel] Pascal Smart Pointers Idea + ARC implementation

2015-10-10 Thread Sven Barth
On 10.10.2015 19:09, Maciej Izak wrote: 2015-10-10 18:40 GMT+02:00 Sven Barth mailto:pascaldra...@googlemail.com>>: While I see and understand your reasoning behind it I don't really like it... There needs to be some better way for this... hmm... :/ I am only sure about MANAGEMENTOPERATO

Re: [fpc-devel] Pascal Smart Pointers Idea + ARC implementation

2015-10-10 Thread Maciej Izak
2015-10-10 13:32 GMT+02:00 Michael Van Canneyt : > > All clear, and I hope to see an ARC implementation based on this "really > soon" :-) > Maybe FPC 4.0? ;) -- Best regards, Maciej Izak ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://

Re: [fpc-devel] Pascal Smart Pointers Idea + ARC implementation

2015-10-10 Thread Maciej Izak
2015-10-10 18:40 GMT+02:00 Sven Barth : > Am 10.10.2015 18:19 schrieb "Maciej Izak" : > > class operator TSmartPtr.Copy(constref aSource: TSmartPtr; var > aDest: TSmartPtr); > > begin > > if aDest.RefCount <> nil then > > Finalize(aDest); > > if aSource.RefCount <> nil then > > InterLo

Re: [fpc-devel] Pascal Smart Pointers Idea + ARC implementation

2015-10-10 Thread Sven Barth
Am 10.10.2015 18:19 schrieb "Maciej Izak" : > class operator TSmartPtr.Copy(constref aSource: TSmartPtr; var aDest: TSmartPtr); > begin > if aDest.RefCount <> nil then > Finalize(aDest); > if aSource.RefCount <> nil then > InterLockedIncrement(aSource.RefCount^); > aDest.RefCount := a

Re: [fpc-devel] Pascal Smart Pointers Idea + ARC implementation

2015-10-10 Thread Maciej Izak
First of all there was small bug in my previous code: wrong usage of Finalize, lack of SmartFinalize and bad parameter for Implicit (keep in mind that this structure will be complemented for TWeakPtr). Correct version: ==begin code== type TSmartPtr = record // similar as overloading

Re: [fpc-devel] Pascal Smart Pointers Idea + ARC implementation

2015-10-10 Thread Michael Van Canneyt
On Sat, 10 Oct 2015, Sven Barth wrote: Am 10.10.2015 12:15 schrieb "Michael Van Canneyt" : Just allow those three operator overloads for normal records and have them be present in the Init RTTI of the record so that fpc_initialize(), fpc_finalize() and fpc_copy() can pick them up. This wi

Re: [fpc-devel] Pascal Smart Pointers Idea + ARC implementation

2015-10-10 Thread Sven Barth
Am 10.10.2015 12:15 schrieb "Michael Van Canneyt" : >> Just allow those three >> operator overloads for normal records and have them be present in the Init >> RTTI of the record so that fpc_initialize(), fpc_finalize() and fpc_copy() >> can pick them up. This will be needed anyway should such recor

Re: [fpc-devel] Pascal Smart Pointers Idea + ARC implementation

2015-10-10 Thread Michael Van Canneyt
On Sat, 10 Oct 2015, Sven Barth wrote: Am 10.10.2015 11:12 schrieb "Michael Van Canneyt" : On Sat, 10 Oct 2015, Maciej Izak wrote: I am working on smart pointers for FPC (something more than pure ARC for classes). This solution is full compatible with existing code base. I would like t

Re: [fpc-devel] Pascal Smart Pointers Idea + ARC implementation

2015-10-10 Thread Sven Barth
Am 10.10.2015 11:12 schrieb "Michael Van Canneyt" : > > > > On Sat, 10 Oct 2015, Maciej Izak wrote: > >> I am working on smart pointers for FPC (something more than pure ARC for >> classes). >> >> This solution is full compatible with existing code base. >> >> I would like to know what do you think

Re: [fpc-devel] Pascal Smart Pointers Idea + ARC implementation

2015-10-10 Thread Michael Van Canneyt
On Sat, 10 Oct 2015, Maciej Izak wrote: I am working on smart pointers for FPC (something more than pure ARC for classes). This solution is full compatible with existing code base. I would like to know what do you think about my conception and work. First step is almost done -> new record o

Re: [fpc-devel] Pascal Smart Pointers Idea + ARC implementation

2015-10-10 Thread Sven Barth
Am 10.10.2015 02:41 schrieb "Maciej Izak" : > First step is almost done -> new record operators: > > === begin code === > {$MODESWITCH MANAGEMENTOPERATORS} > type // Record with automatic constructor and destructor > TValue = record > class operator Initialize(var aRec: TValue); > class o