Re: [fpc-pascal] Managed record questions

2018-03-09 Thread Sven Barth via fpc-pascal
Am 09.03.2018 16:41 schrieb "Ryan Joseph" : > On Mar 9, 2018, at 4:51 PM, Sven Barth via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > > Objects share roughly as much code with records as classes do as internally classes and objects share most of their code. > I’ll be curious what Maci

Re: [fpc-pascal] Managed record questions

2018-03-09 Thread Ryan Joseph
> On Mar 9, 2018, at 4:51 PM, Sven Barth via fpc-pascal > wrote: > > Objects share roughly as much code with records as classes do as internally > classes and objects share most of their code. > I’ll be curious what Maciej says about management operators in objects then. Classes don’t hav

[fpc-pascal] Weird FPC String Manager Bug

2018-03-09 Thread Tony Whyman
There seems to be some sort of weird race condition with the FPC string/memory manager. It is not easy to replicate, but the program Gabor Boros posted earlier today to the Lazarus list does seem to find the problem consistently. The program he posted is a simple example of using MWA's Firebir

Re: [fpc-pascal] Managed record questions

2018-03-09 Thread Ryan Joseph
> On Mar 9, 2018, at 4:13 PM, Ryan Joseph wrote: > > type > TDataObject = object > v: array[0..2] of integer; > end; > > procedure TestObjectCopy; > var > obj: TDataObject; > data: array[0..2] of integer; > i: integer; > begin > for i := 0 to 2

Re: [fpc-pascal] Managed record questions

2018-03-09 Thread Sven Barth via fpc-pascal
Am 09.03.2018 10:14 schrieb "Ryan Joseph" : > >> 4) Move() on an object copies memory like a record (as a record does, so this is good). Does that mean they laid out in memory just like records? > > Yes, although I believe there is a hidden VMT field. Not sure how they look in memory but that co

Re: [fpc-pascal] Managed record questions

2018-03-09 Thread Ryan Joseph
> On Mar 9, 2018, at 3:55 PM, Michael Van Canneyt > wrote: > > Hence my proposal to 'clean this up’. A good idea if they would be used. If objects had a couple minor things I personally could replace some records in certain parts of code and get real benefits. Someone on the compiler team w

Re: [fpc-pascal] Managed record questions

2018-03-09 Thread Michael Van Canneyt
On Fri, 9 Mar 2018, Ryan Joseph wrote: On Mar 9, 2018, at 1:53 PM, Sven Barth via fpc-pascal wrote: They are broken, deprecated and essentially dead in Delphi, but in FPC we've always cared for them as well. Overloads and generics are already supported and support for helpers could be e

Re: [fpc-pascal] Managed record questions

2018-03-09 Thread Ryan Joseph
> On Mar 9, 2018, at 1:53 PM, Sven Barth via fpc-pascal > wrote: > > They are broken, deprecated and essentially dead in Delphi, but in FPC we've > always cared for them as well. > Overloads and generics are already supported and support for helpers could be > easily added. Only major featur