Re: [fpc-pascal] replacement of MARK and RELEASE function in free pascal

2014-06-19 Thread Sven Barth
On 19.06.2014 16:37, joha...@nacs.net wrote: On Thu, Jun 19, 2014 at 03:28:42PM +0200, Sven Barth wrote: On 19.06.2014 13:29, Karoly Balogh (Charlie/SGR) wrote: So either you use mypointer:=GetMem(size); or GetMem(mypointer, size); both are valid. If you need to allocate heap space for a record

Re: [fpc-pascal] replacement of MARK and RELEASE function in free pascal

2014-06-19 Thread Karoly Balogh (Charlie/SGR)
Hi, On Thu, 19 Jun 2014, joha...@nacs.net wrote: > I seem to remember being warned in the old days of Turbo Pascal not mix use of > getmem()/freemem() and new()/dispose() within a program, due to differences in > the memory allocation strategies. Are there still any compatibility or > efficiency

Re: [fpc-pascal] replacement of MARK and RELEASE function in free pascal

2014-06-19 Thread johanns
On Thu, Jun 19, 2014 at 03:28:42PM +0200, Sven Barth wrote: On 19.06.2014 13:29, Karoly Balogh (Charlie/SGR) wrote: So either you use mypointer:=GetMem(size); or GetMem(mypointer, size); both are valid. If you need to allocate heap space for a record, use New/Dispose, or GetMem(myptr, sizeof(Tmy

Re: [fpc-pascal] replacement of MARK and RELEASE function in free pascal

2014-06-19 Thread Sven Barth
On 19.06.2014 13:29, Karoly Balogh (Charlie/SGR) wrote: So either you use mypointer:=GetMem(size); or GetMem(mypointer, size); both are valid. If you need to allocate heap space for a record, use New/Dispose, or GetMem(myptr, sizeof(Tmyrecord)); I wouldn't use GetMem() in case of record pointer

Re: [fpc-pascal] replacement of MARK and RELEASE function in free pascal

2014-06-19 Thread mokashe.ram
Ok Thanks, Karoly -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/replacement-of-MARK-and-RELEASE-function-in-free-pascal-tp5719624p5719629.html Sent from the Free Pascal - General mailing list archive at Nabble.com. ___

Re: [fpc-pascal] replacement of MARK and RELEASE function in free pascal

2014-06-19 Thread Karoly Balogh (Charlie/SGR)
Hi, On Thu, 19 Jun 2014, mokashe.ram wrote: > Ok thanks, > >but using untyped pointer how to mention size in GETMEM()? > > * GETMEM(markexam,'' ");* It's detailed in the documentation, it's detailed there along with the rest of the memory management functions, please refer to that:

Re: [fpc-pascal] replacement of MARK and RELEASE function in free pascal

2014-06-19 Thread Marco van de Voort
In our previous episode, mokashe.ram said: > Ok thanks, > >but using untyped pointer how to mention size in GETMEM()? > > * GETMEM(markexam,'' ");* You misunderstood. You don't substitute getmem/freemem (or new/dispose) of just the markexam pointer, but for ALL pointers all

Re: [fpc-pascal] replacement of MARK and RELEASE function in free pascal

2014-06-19 Thread mokashe.ram
Ok thanks, but using untyped pointer how to mention size in GETMEM()? * GETMEM(markexam,'' ");* Thanks Sudarshan -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/replacement-of-MARK-and-RELEASE-function-in-free-pascal-tp5719624p5719626.ht

Re: [fpc-pascal] replacement of MARK and RELEASE function in free pascal

2014-06-19 Thread Marco van de Voort
In our previous episode, mokashe.ram said: > Can any one help me on raplacement of MARK and RELEASE function in free > pascal... > >var > markexam: pointer; // untyped pointer > begin > ... >* mark(markexam); > . > Release(ma

[fpc-pascal] replacement of MARK and RELEASE function in free pascal

2014-06-19 Thread mokashe.ram
Hi, Can any one help me on raplacement of MARK and RELEASE function in free pascal... var markexam: pointer; // untyped pointer begin ... * mark(markexam); . Release(markexam);* end; Thanks, Sud -- View this message in con