linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Nicholas T Ingolia <ingolia@MIT.EDU>
To: Alain Birtz <abz@videotron.ca>
Cc: linuxppc-dev@lists.linuxppc.org
Subject: Re: Realloc() problem with Efence
Date: Wed, 28 Jul 1999 17:03:39 -0300	[thread overview]
Message-ID: <199907282103.RAA28451@thanatopsis.mit.edu> (raw)
In-Reply-To: Your message of "Wed, 28 Jul 1999 16:48:42 CDT." <379F7AB9.E8D230CE@videotron.ca>


-----BEGIN PGP SIGNED MESSAGE-----

Hello...

realloc() may move the memory being realloated.  To quote from the man page,

       realloc() returns a pointer to the newly allocated memory,
       which is suitably aligned for any kind of variable and may
       be  different from ptr...

It doesn't (and couldn't) mutate the pointer temp_c_buf directly.

Thus, you probably want to re-write your code to do

temp_c_buf = realloc(temp_c_buf, 5000 + 5000);

- --Nicholas Ingolia
ingolia@mit.edu
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 5.0i for non-commercial use
Comment: Processed by Mailcrypt 3.5.3, an Emacs/PGP interface
Charset: noconv

iQCVAwUBN59h+gRHXKx72OUhAQEkNAP/bYZO+zzGI2bDBRuCYabEfaxo8/EAffTN
hliGzKLwhhEetuvrUNv+pam5qBXGb3OLWWAZdRmypEvPXfYP/w3wGlJlGKWxAbGm
WhBJkzwVWEkqKmqADiClP7ucJcMIYkMcLLVcCBnVEsjoPFDumoc2ncEe6beeRDIB
gma/mrLVmZs=
=tyhG
-----END PGP SIGNATURE-----

[[ This message was sent via the linuxppc-dev mailing list.  Replies are ]]
[[ not  forced  back  to the list, so be sure to Cc linuxppc-dev if your ]]
[[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting.   ]]

  reply	other threads:[~1999-07-28 20:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-07-28 21:48 Realloc() problem with Efence Alain Birtz
1999-07-28 20:03 ` Nicholas T Ingolia [this message]
1999-07-28 20:54 ` Jerry Quinn

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=199907282103.RAA28451@thanatopsis.mit.edu \
    --to=ingolia@mit.edu \
    --cc=abz@videotron.ca \
    --cc=linuxppc-dev@lists.linuxppc.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 NNTP newsgroup(s).