This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: realloc without moving?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]