public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Why malloc() when target code is executed?
@ 2003-08-22 20:49 Josef Wolf
  2003-08-25 18:25 ` Kevin Buettner
  0 siblings, 1 reply; 5+ messages in thread
From: Josef Wolf @ 2003-08-22 20:49 UTC (permalink / raw)
  To: gdb

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 --

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-08-27 16:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-22 20:49 Why malloc() when target code is executed? Josef Wolf
2003-08-25 18:25 ` Kevin Buettner
2003-08-25 19:57   ` Josef Wolf
2003-08-25 22:08     ` Andrew Cagney
2003-08-27 16:50   ` David Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).