This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Is it possible to detect the memory status ?


Mustafa4LP wrote:

> I am wondering whether it is possible to detect that a memory is already
> freed or not in a C program.
> Like if there is some pointer which points to certain memory and I want it
> to free but the problem is that it may already be freed.
> is there any routine which can tell me that if the memory is freed or not
> and does the memory belongs to the constant string (which is global) ?

No, sorry.

> If this is not available with the current compilers, is it possible to
> implement such library functions ?

I can't think of any way of doing it without writing or modifying an
allocation library.

Andrew.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]