This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: Persistent malloc
- From: Florian Weimer <fweimer at redhat dot com>
- To: Carlos O'Donell <carlos at redhat dot com>, Adrian May <adrian dot alexander dot may at gmail dot com>, libc-help at sourceware dot org
- Date: Wed, 8 Nov 2017 06:52:52 +0100
- Subject: Re: Persistent malloc
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=fweimer at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D3E357EA8E
- References: <CAD-UbzHRNzchaBNVR67v1NUAi25h09_9291THRto_iyBRSEYDg@mail.gmail.com> <05658ae7-3abc-d63a-1f71-833bf1e4570e@redhat.com>
On 11/07/2017 09:25 PM, Carlos O'Donell wrote:
I just managed to make a persistent malloc by replacing MORECORE. My init
routine opens a file and maps it to a huge space at a fixed address, then I
just ftruncate the file when somebody asks my MORECORE for more:
We are going to remove the MORECORE hook soon. Newly compiled binaries
will no longer call it.
You need to provide your own malloc if you want to change this behavior:
<https://www.gnu.org/software/libc/manual/html_node/Replacing-malloc.html>
Thanks,
Florian