Re: [fpc-pascal] Does ReallocMem(p,0) always set p to nil?

2007-05-07 Thread Vincent Snijders
Vincent Snijders schreef: Hi, Consider this piece of code: var p: pointer; begin p := getmem(100); reallocmem(p,0); p := nil; end. Do I need to do p:=nil, if I want to be sure that p contains nil? I saw that both system.SysReAllocMem and cmem.CReAllocMem do this, is size=0, but the

Re: [fpc-pascal] Does ReallocMem(p,0) always set p to nil?

2007-05-07 Thread Michael Van Canneyt
On Mon, 7 May 2007, Vincent Snijders wrote: Vincent Snijders schreef: Hi, Consider this piece of code: var p: pointer; begin p := getmem(100); reallocmem(p,0); p := nil; end. Do I need to do p:=nil, if I want to be sure that p contains nil? I saw that

Re: [fpc-pascal] Does ReallocMem(p,0) always set p to nil?

2007-05-07 Thread Vincent Snijders
Michael Van Canneyt schreef: On Mon, 7 May 2007, Vincent Snijders wrote: Vincent Snijders schreef: Hi, Consider this piece of code: var p: pointer; begin p := getmem(100); reallocmem(p,0); p := nil; end. Do I need to do p:=nil, if I want to be sure that p contains nil? I saw that

[fpc-pascal] Does ReallocMem(p,0) always set p to nil?

2007-05-03 Thread Vincent Snijders
Hi, Consider this piece of code: var p: pointer; begin p := getmem(100); reallocmem(p,0); p := nil; end. Do I need to do p:=nil, if I want to be sure that p contains nil? I saw that both system.SysReAllocMem and cmem.CReAllocMem do this, is size=0, but the docs at