This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: Suggestion: try_realloc
- From: Paul Pluzhnikov <ppluzhnikov at google dot com>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: Niels Möller <nisse at lysator dot liu dot se>, libc-help at sourceware dot org, Marco Bodrato <bodrato at mail dot dm dot unipi dot it>, Torbjorn Granlund <tg at gmplib dot org>
- Date: Tue, 26 Feb 2013 08:01:32 -0800
- Subject: Re: Suggestion: try_realloc
- References: <nn4nh0qsgc.fsf@stalhein.lysator.liu.se> <512CD7A2.8020509@redhat.com>
On Tue, Feb 26, 2013 at 7:41 AM, Florian Weimer <fweimer@redhat.com> wrote:
> For std::vector, it would be beneficial to have an interface which succeeds
> only if the address doesn't change. I think this would fit your needs as
> well.
jemalloc implements this (and more), and fbvector uses it with
significant speedups observed:
https://github.com/facebook/folly/blob/master/folly/docs/FBVector.md
I suggest reading http://linux.die.net/man/3/jemalloc man page for inspiration.
--
Paul Pluzhnikov