This is the mail archive of the libc-alpha@sourceware.org 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: [PATCH] [RFC] malloc: Reduce worst-case behaviour with madvise and refault overhead


On 02/09/2015 09:52 PM, Carlos O'Donell wrote:
> On 02/09/2015 09:06 AM, Mel Gorman wrote:
>> while (data_to_process) {
>> 	buf = malloc(large_size);
>> 	do_stuff();
>> 	free(buf);
>> }
> 
> Why isn't the fix to change the application to hoist the
> malloc out of the loop?

For a lot of C++ code, this would require replacing global operator new
with a pool allocator.  We do not want programmers to do that, for
various reasons (loss of tooling, our limited malloc hardening, etc.).

-- 
Florian Weimer / Red Hat Product Security


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