Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Hans-Peter Diettrich Newsgroups: comp.lang.pascal.delphi.misc Subject: Re: Delphi D4: using pointers to transfer data from COMM queue to circular queue Date: Fri, 19 Aug 2016 12:34:55 +0200 Lines: 20 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net baFKmkYYy+2IcfCk5pn5ZgPvaQv5miwqp0PfTSGB+AT1ZX8vR6 Cancel-Lock: sha1:djrAgCNmdKPh85LmjtIpEHZRbqA= User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) In-Reply-To: Xref: csiph.com comp.lang.pascal.delphi.misc:719 P E Schoen schrieb: > In the previous procedure for SerialNG, I did this: > > var > RecdPtr: PChar; > begin > RecdPtr := CommSerialPort.ReadNextCluster( NCSize, RdErrors ); > ... > FreeMem( RecdPtr, NCSize ); // Added 4/8/09 > end; > ======================================================== > > I don't know if that was a problem or not. It seems that I might need to > reserve memory for the PChar before using it? Various implementations of ReadNextCluster are possible. It may be required or forbidden to free the memory of the returned pointer. DoDi