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 report that this doesn't work anymore in FreePascal (and not 
even in BP7, IIRC) or shall I simply write it off as intentionally 
compiler-dependent and non-portable?


Vinzent.
-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


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 explanation about this in FPC doc.



  
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


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.


Jonas___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


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 Ansistrings; 3.3.1 Arrays: Dynamic Array; 7.6 Reference counting.

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.



  

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


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 in detail in FPC Language Reference Guide: 
 3.2.4 Ansistrings; 3.3.1 Arrays: Dynamic Array; 7.6 Reference counting.

And the last one explicitly states No assumptions should be made about the 
number of temporary variables or the time when they are finalized.

 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.

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 and 
http://bugs.freepascal.org/view.php?id=9472


Jonas___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


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 
http://www.mail-archive.com/fpc-de...@lists.freepascal.org/msg11126.html


Jonas___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


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 code is simply 
broken. See e.g. http://bugs.freepascal.org/view.php?id=15526 and 
http://bugs.freepascal.org/view.php?id=9472

Thanks also for the your emphatic statement, and the links, of course.



  
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal