This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: realloc without moving?
- From: Ulrich Drepper <drepper at redhat dot com>
- To: chris <caj at cs dot york dot ac dot uk>
- Cc: libc-alpha at sources dot redhat dot com
- Date: Thu, 28 Oct 2004 14:52:45 -0700
- Subject: Re: realloc without moving?
- Organization: Red Hat, Inc.
- References: <418163A8.9040003@cs.york.ac.uk>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
chris wrote:
> Is there a function in glibc like realloc, except in the case where it
> is not possible to extend the existing memory then instead of allocating
> a new block of memory and copying the old block into this area the
> function simply returns?
There is not code like this. You can query in glibc's implementation
the actual maximum block size with malloc_usable_size() although I don't
know whether this works in all situations. It simply never has been
used much.
- --
â Ulrich Drepper â Red Hat, Inc. â 444 Castro St â Mountain View, CA â
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
iD8DBQFBgWot2ijCOnn/RHQRAjpfAJ0aY+MtEex1ySVDKxibh5O+m61FngCfQ0W+
dzejHb0R9yS5yMONGvYM6Z0=
=0Qr/
-----END PGP SIGNATURE-----