Re: [fpc-devel] Bug in PWidechar and refcounting

2005-02-16 Thread Alexey Barkovoy
- Original Message - From: "DrDiettrich" <[EMAIL PROTECTED]> To: "FPC developers' list" Sent: Tuesday, February 15, 2005 4:11 AM Subject: Re: [fpc-devel] Bug in PWidechar and refcounting Alexey Barkovoy wrote: PAnsiChar, PChar are just pointers and no

Re: [fpc-devel] Bug in PWidechar and refcounting

2005-02-16 Thread Peter Vreman
> Alexey Barkovoy wrote: >> PAnsiChar, PChar are just pointers and not garbage collected by >> compiler. But >> AnsiString and WideString are compiler managed types. So, as Peter >> mentioned, >> behaviour you are seeing is by design. > > In Delphi WideString is not reference counted at all. The la

Re: [fpc-devel] Bug in PWidechar and refcounting

2005-02-15 Thread DrDiettrich
Alexey Barkovoy wrote: > PAnsiChar, PChar are just pointers and not garbage collected by compiler. But > AnsiString and WideString are compiler managed types. So, as Peter mentioned, > behaviour you are seeing is by design. In Delphi WideString is not reference counted at all. The layout of the st

Re: [fpc-devel] Bug in PWidechar and refcounting

2005-02-13 Thread Peter Vreman
> Hi all, > > the bug-report on the website doesn't work, so I write a mail: > > If you assign a widechar to a pwidechar, the refcount isn't > increased. This construct is often used in the variants-code, which is > allowed, according to the comments at the top of wstrings.inc. > > An example: > >

Re: [fpc-devel] Bug in PWidechar and refcounting

2005-02-13 Thread Peter Vreman
> Hi all, > > the bug-report on the website doesn't work, so I write a mail: > > If you assign a widechar to a pwidechar, the refcount isn't > increased. This construct is often used in the variants-code, which is > allowed, according to the comments at the top of wstrings.inc. > > An example: > >

Re: [fpc-devel] Bug in PWidechar and refcounting

2005-02-13 Thread Peter Vreman
> Hi all, > > the bug-report on the website doesn't work, so I write a mail: > > If you assign a widechar to a pwidechar, the refcount isn't > increased. This construct is often used in the variants-code, which is > allowed, according to the comments at the top of wstrings.inc. > > An example: > >

Re: [fpc-devel] Bug in PWidechar and refcounting

2005-02-13 Thread Alexey Barkovoy
Normally I would aggree with you, but as far as I can see, PWideChar is also an automated type. (If not then large parts of the variant-code in the RTL has to be rewritten, and probably alsoe the wstrings.inc file) From wstrings.inc: WideString is defined as a 'silent' pwidechar : a pwidechar tha

RE: [fpc-devel] Bug in PWidechar and refcounting

2005-02-13 Thread Joost van der Sluis
> if when someone does pcharvar := ansistringvar or pwidecharvar := > widestringvar we increased the refcount every program that used that > construct would leak memory. Normally I would aggree with you, but as far as I can see, PWideChar is also an automated type. (If not then large parts of the

RE: [fpc-devel] Bug in PWidechar and refcounting

2005-02-12 Thread peter green
elopers' list > Subject: [fpc-devel] Bug in PWidechar and refcounting > > > Hi all, > > the bug-report on the website doesn't work, so I write a mail: > > If you assign a widechar to a pwidechar, the refcount isn't > increased. This construct is often used in

[fpc-devel] Bug in PWidechar and refcounting

2005-02-12 Thread Joost van der Sluis
Hi all, the bug-report on the website doesn't work, so I write a mail: If you assign a widechar to a pwidechar, the refcount isn't increased. This construct is often used in the variants-code, which is allowed, according to the comments at the top of wstrings.inc. An example: Program test; var