public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Alexandre Oliva <aoliva@redhat.com>
To: "Mynampati, Venkata S." <MynamVS@nsc-msg01.network.com>
Cc: "'gcc-help@gcc.gnu.org'" <gcc-help@gcc.gnu.org>
Subject: Re: How to tell compiler to use my_malloc inplace of normal 'malloc'
Date: Thu, 23 Aug 2001 23:39:00 -0000	[thread overview]
Message-ID: <orsneit30c.fsf@feijoada.lsd.ic.unicamp.br> (raw)
In-Reply-To: <A7E1C26945C8D211ADBF0008C709661A035F2B2A@nsc-msg02.network.com>

On Aug 22, 2001, "Mynampati, Venkata S." <MynamVS@nsc-msg01.network.com> wrote:

> I read that while compiling i can tell the compiler to replace all mallocs
> with my wrapper function called 'my_malloc', in which, i do something
> and call malloc.

You can do this if you're using the GNU linker: it accepts
-wrap=malloc, so you define _wrap_malloc and call _real_malloc() in it
whenever you mean to call the actual malloc.  Of course, you only use
this at link time.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

  parent reply	other threads:[~2001-08-23 23:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-22 14:42 Mynampati, Venkata S.
2001-08-22 15:12 ` Ryan T. Sammartino
2001-08-23 23:39 ` Alexandre Oliva [this message]
2001-08-23  7:45 Mynampati, Venkata S.
2001-08-23  8:38 ` John Love-Jensen
2001-08-23  8:04 Mirko Vogel
2001-08-23  8:26 ` John Love-Jensen

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=orsneit30c.fsf@feijoada.lsd.ic.unicamp.br \
    --to=aoliva@redhat.com \
    --cc=MynamVS@nsc-msg01.network.com \
    --cc=gcc-help@gcc.gnu.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).