This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] calloc should not duplicate malloc logic.
- From: Will Newton <will dot newton at linaro dot org>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: Ondřej Bílka <neleai at seznam dot cz>, libc-alpha <libc-alpha at sourceware dot org>
- Date: Wed, 26 Feb 2014 12:27:28 +0000
- Subject: Re: [PATCH] calloc should not duplicate malloc logic.
- Authentication-results: sourceware.org; auth=none
- References: <20140221150417 dot GA4198 at domone dot podge> <530DD28C dot 50408 at redhat dot com>
On 26 February 2014 11:39, Florian Weimer <fweimer@redhat.com> wrote:
> On 02/21/2014 04:04 PM, OndÅej BÃlka wrote:
>>
>> Hi,
>>
>> To make future improvements of allocator simpler we could for now calloc
>> just call malloc and memset. With that we could omit a changes that
>> would duplicate malloc changes anyway.
>>
>> It would temporarily decrease its performance, which is not primary
>> concern now as we just started release cycle.
>
>
> I tested the current implementation (well, in 2.18 in Fedora 20), and it
> does not avoid the memset for large arrays, at least I see an RSS value that
> matches the size of the allocated array. So I suppose this change is okay
> because it does not seem likely it adds further breakage for applications
> which rely on memory overcommit.
However without any performance numbers this seems a change with a
reasonable likelihood of causing performance regressions.
--
Will Newton
Toolchain Working Group, Linaro