This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: malloc and free
- From: Ken Foskey <foskey at optushome dot com dot au>
- To: gcc help <gcc-help at gcc dot gnu dot org>
- Date: Wed, 29 Dec 2004 20:53:50 +1100
- Subject: Re: malloc and free
- Organization: openoffice.org
- References: <20041224184034.16784.qmail@web52908.mail.yahoo.com>
On Fri, 2004-12-24 at 18:40 +0000, Ankit Jain wrote:
> hi
>
> routine xyz uses malloc and free functions. it gives
> accurate and correct result if called once.
>
> but if the function is called in a loop N number of
> times then probably it gives segmentation fault.
>
> what is the reason? can any body guess or test code
> is needed?
If you are using Linux X86 try the code under valgrind.
You could also compile your code with -g and run it under gdb.
Otherwise your question is so vague it is impossible to work out how to
help you.
--
Ken Foskey
OpenOffice.org developer