This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Why malloc() when target code is executed?
- From: Josef Wolf <jw at raven dot inka dot de>
- To: gdb at sources dot redhat dot com
- Date: Fri, 22 Aug 2003 22:48:44 +0200
- Subject: Why malloc() when target code is executed?
Hello!
I just noticed that ``print printf("Hello\n")'' call malloc() on the target
to allocate the memory for the string. AFAICS, this memory never gets freed.
Is there any reason not to allocate this memory on the stack? This would
avoid this memory leak. In addition, this would make it possible to use this
feature on embedded systems which often have either restricted memory or
even dont have malloc() at all.
--
Please visit and sign http://petition-eurolinux.org and http://www.ffii.org
-- Josef Wolf -- jw@raven.inka.de --