Test if memory pointer is valid?
- From: "Richard A. DeVenezia" <rdevenezia@xxxxxxxxxxxx>
- Date: Thu, 26 Jan 2006 21:38:41 -0500
Is there a way or technique for knowing if a pointer points to memory that
has been freed ?
The example is a little silly, in reality, P & Q might fields in instances
of disparate classes
P: Pointer;
Q: Pointer;
BuffSize: Integer;
BuffSize := 32000;
GetMem(P, BuffSize);
F.Read(P^,BuffSize);
....
Q := P;
....
if ...
FreeMem(P,BuffSize)
....
if [ Q points to memory that has not been freed ] // what technique, if
any, can test this?
FreeMem (Q,BuffSize);
end;
--
Richard A. DeVenezia
.
- Follow-Ups:
- Re: Test if memory pointer is valid?
- From: Paul E. Schoen
- Re: Test if memory pointer is valid?
- From: Rob Kennedy
- Re: Test if memory pointer is valid?
- Prev by Date: Re: Event handlers...
- Next by Date: Re: Test if memory pointer is valid?
- Previous by thread: Event handlers...
- Next by thread: Re: Test if memory pointer is valid?
- Index(es):
Relevant Pages
|