Re: [fpc-pascal] How are Assigned, Free, Nil and Destroy related?

2011-10-24 Thread Mark Morgan Lloyd
Ralf A. Quint wrote: At 11:52 AM 10/23/2011, Frank Peelo wrote: If I recall corerctly, that Modula-2 value for nil was the address the 8086 jumped to when released from RESET. So jumping through a pointer with value nil would be something you would notice pretty much immediately. Certainly

Re: [fpc-pascal] How are Assigned, Free, Nil and Destroy related?

2011-10-23 Thread Frank Peelo
On 22/10/11 10:01, Mark Morgan Lloyd wrote: Felipe Monteiro de Carvalho wrote: Free is how you release the memory allocated for a object. Free calls Destroy. Never call Destroy manually. When you implement the destructor you always implement Destroy, never change Free. A number of years ago,

Re: [fpc-pascal] How are Assigned, Free, Nil and Destroy related?

2011-10-23 Thread Ralf A. Quint
At 11:52 AM 10/23/2011, Frank Peelo wrote: If I recall corerctly, that Modula-2 value for nil was the address the 8086 jumped to when released from RESET. So jumping through a pointer with value nil would be something you would notice pretty much immediately. Certainly not. Modula-2 was/is

Re: [fpc-pascal] How are Assigned, Free, Nil and Destroy related?

2011-10-22 Thread Felipe Monteiro de Carvalho
I understand Assigned as being the same as nil, so Assigned(Object) = Object nil I vaguely remember that it could be safer in some corner case, but I don't remember ever meting that. Free is how you release the memory allocated for a object. Free calls Destroy. Never call Destroy manually.

Re: [fpc-pascal] How are Assigned, Free, Nil and Destroy related?

2011-10-22 Thread Alexander Shishkin
22.10.2011 10:20, Felipe Monteiro de Carvalho пишет: I understand Assigned as being the same as nil, so Assigned(Object) = Object nil I vaguely remember that it could be safer in some corner case, but I don't remember ever meting that. Method pointers?

Re: [fpc-pascal] How are Assigned, Free, Nil and Destroy related?

2011-10-22 Thread Frank Church
On 22 October 2011 07:20, Felipe Monteiro de Carvalho felipemonteiro.carva...@gmail.com wrote: I understand Assigned as being the same as nil, so Assigned(Object) = Object nil I vaguely remember that it could be safer in some corner case, but I don't remember ever meting that. Free is

RE : [fpc-pascal] How are Assigned, Free, Nil and Destroy related?

2011-10-22 Thread Ludo Brands
Nil is not a routine, it is a value, it means that the object is empty, it does not exist / is not allocated. Nil in existing implementations that I know is represented by the value zero. The typical life-cycle of a object is: MyObject := TMyObject.Create; try

RE : [fpc-pascal] How are Assigned, Free, Nil and Destroy related?

2011-10-22 Thread Ludo Brands
When the loop runs again Assigned in InitVars is false so as soon as those FBreakStrings and SCStrings are accessed within the loop a SIGSEGV occurs. So what I want to know is whether Assigned remains true when Free is executed. See my previous answer. There is a helper function

Re: RE : [fpc-pascal] How are Assigned, Free, Nil and Destroy related?

2011-10-22 Thread Frank Church
On 22 October 2011 08:14, Ludo Brands ludo.bra...@free.fr wrote: Nil is not a routine, it is a value, it means that the object is empty, it does not exist / is not allocated. Nil in existing implementations that I know is represented by the value zero. The typical life-cycle of a object

Re: [fpc-pascal] How are Assigned, Free, Nil and Destroy related?

2011-10-22 Thread tcoq
this helps, Thierry - Mail Original - De: Frank Church vfcli...@gmail.com À: FPC-Pascal users discussions fpc-pascal@lists.freepascal.org Envoyé: Samedi 22 Octobre 2011 09h08:17 GMT +01:00 Amsterdam / Berlin / Berne / Rome / Stockholm / Vienne Objet: Re: [fpc-pascal] How are Assigned, Free

RE : RE : [fpc-pascal] How are Assigned, Free, Nil and Destroy related?

2011-10-22 Thread Ludo Brands
Does that mean that Free itself reclaims the memory used by the object's fields and properties but does not release the memory used by the TObject or pointer itself, where as setting it to nil or executing Destroy does, or does Destroy do something different? All memory is released

Re: RE : [fpc-pascal] How are Assigned, Free, Nil and Destroy related?

2011-10-22 Thread Felipe Monteiro de Carvalho
On Sat, Oct 22, 2011 at 9:36 AM, Frank Church vfcli...@gmail.com wrote: Does that mean that Free itself reclaims the memory used by the object's fields and properties but does not release the memory used by the TObject or pointer itself, where as setting it to nil or executing Destroy does, or

Re: [fpc-pascal] How are Assigned, Free, Nil and Destroy related?

2011-10-22 Thread Mark Morgan Lloyd
Felipe Monteiro de Carvalho wrote: Free is how you release the memory allocated for a object. Free calls Destroy. Never call Destroy manually. When you implement the destructor you always implement Destroy, never change Free. A number of years ago, Matthew Jones's wife looked over his

Re: [fpc-pascal] How are Assigned, Free, Nil and Destroy related?

2011-10-22 Thread Marco van de Voort
In our previous episode, Felipe Monteiro de Carvalho said: Nil is not a routine, it is a value, it means that the object is empty, it does not exist / is not allocated. Nil in existing implementations that I know is represented by the value zero. Look better in, euh, Free Pascal, and see what

[fpc-pascal] How are Assigned, Free, Nil and Destroy related?

2011-10-21 Thread Frank Church
This is one question I have wanted to ask for a long time. How are Assigned, Free, Nil and Destroy related, and when is one or another appropriate? What other procedure have I missed? There are so many articles and mailing list threads on this issue that I don't think asking it makes me sound