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: [COMMITTED] malloc: Consistently apply trim_threshold to all heaps.


"Carlos O'Donell" <carlos@redhat.com> writes:

> diff --git a/malloc/arena.c b/malloc/arena.c
> index b44e307..cb45a04 100644
> --- a/malloc/arena.c
> +++ b/malloc/arena.c
> @@ -696,14 +696,20 @@ heap_trim (heap_info *heap, size_t pad)
>      }
>  
>    /* Uses similar logic for per-thread arenas as the main arena with systrim
> -     by preserving the top pad and at least a page.  */
> +     and _int_free by preserving the top pad and rounding down to the nearest
> +     page.  */
>    top_size = chunksize (top_chunk);
> +  if ((unsigned long)(top_size) <
> +      (unsigned long)(mp_.trim_threshold))

Line break before the operator, not after.  Also, the parens are useless
and confusing.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


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