Re: [fpc-pascal] Is this a reference counting bug?

2010-05-07 Thread Vinzent Höfler
Bihar Anwar bihar_an...@rocketmail.com Moreover, I've seen many Delphi code snippets out there (e.g. http://www.cs.wisc.edu/~rkennedy/array-delete) rely on reference counting behaviour. Great. I once wrote code that relied on Turbo Pascal's heap list structure internals. Shall I post a bug

Re: [fpc-pascal] Is this a reference counting bug?

2010-05-02 Thread Bihar Anwar
Florian Klaempfl: FPC and Delphi handle code generation for ref. counted types slightly different, so there might be cases where the ref. counter differs. As long as there is no memory leak when the vars are properly used, we don't consider it as a bug. I see, well, there should be

Re: [fpc-pascal] Is this a reference counting bug?

2010-05-02 Thread Jonas Maebe
On 02 May 2010, at 10:30, Bihar Anwar wrote: I see, well, there should be explanation about this in FPC doc. The reference counting logic is considered to be an opaque implementation detail (whose implementation can change at any time). It is undocumented by design.

Re: [fpc-pascal] Is this a reference counting bug?

2010-05-02 Thread Bihar Anwar
On May 2, 2010 4:24:37 PM, Jonas Maebe wrote: The reference counting logic is considered to be an opaque implementation detail (whose implementation can change at any time). It is undocumented by design. In fact, it was already documented in detail in FPC Language Reference Guide: 3.2.4

Re: [fpc-pascal] Is this a reference counting bug?

2010-05-02 Thread Jonas Maebe
On 02 May 2010, at 13:46, Bihar Anwar wrote: On May 2, 2010 4:24:37 PM, Jonas Maebe wrote: The reference counting logic is considered to be an opaque implementation detail (whose implementation can change at any time). It is undocumented by design. In fact, it was already documented

Re: [fpc-pascal] Is this a reference counting bug?

2010-05-02 Thread Jonas Maebe
On 02 May 2010, at 14:05, Jonas Maebe wrote: I know, we've had bug reports about that in the past. Such code is simply broken. See e.g. http://bugs.freepascal.org/view.php?id=15526 andhttp://bugs.freepascal.org/view.php?id=9472 And the thread starting with

Re: [fpc-pascal] Is this a reference counting bug?

2010-05-02 Thread Bihar Anwar
From: Jonas Maebe, May 2, 2010 7:05:46 PM And the last one explicitly states No assumptions should be made about the number of temporary variables or the time when they are finalized. I see, thanks Jonas for noting that statements. I know, we've had bug reports about that in the past. Such

[fpc-pascal] Is this a reference counting bug?

2010-05-01 Thread Bihar Anwar
I found that the last element of a dynamic array starts with reference count = 2 in FPC, but in Delphi is 1. Is this an FPC bug, or FPC implements reference counting differ from Delphi? type PAnsiRec = ^TAnsiRec; TAnsiRec = packed Record Ref, Len : SizeInt; First : Char;