Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Josef Wolf <jw@raven.inka.de>
To: gdb@sources.redhat.com
Subject: Why malloc() when target code is executed?
Date: Fri, 22 Aug 2003 20:49:00 -0000	[thread overview]
Message-ID: <20030822204844.GC14466@raven.inka.de> (raw)

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


             reply	other threads:[~2003-08-22 20:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-22 20:49 Josef Wolf [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030822204844.GC14466@raven.inka.de \
    --to=jw@raven.inka.de \
    --cc=gdb@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox