This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PING^2][PATCH] Reformat malloc to gnu style.
- From: Siddhesh Poyarekar <siddhesh at redhat dot com>
- To: OndÅej BÃlka <neleai at seznam dot cz>
- Cc: Allan McRae <allan at archlinux dot org>, libc-alpha at sourceware dot org
- Date: Thu, 2 Jan 2014 15:24:20 +0530
- Subject: Re: [PING^2][PATCH] Reformat malloc to gnu style.
- Authentication-results: sourceware.org; auth=none
- References: <20131211102701 dot GA25483 at domone dot podge> <20131217095418 dot GA23717 at domone dot podge> <20131230152001 dot GA5214 at domone> <52C2BF2A dot 9010009 at archlinux dot org> <20140101132020 dot GA12317 at domone> <52C4A758 dot 9070802 at archlinux dot org> <20140102034542 dot GG5374 at spoyarek dot pnq dot redhat dot com> <52C50A54 dot 5060906 at archlinux dot org> <20140102090824 dot GA18222 at domone>
On Thu, Jan 02, 2014 at 10:08:24AM +0100, OndÅej BÃlka wrote:
> + if (have_lock
> + || ({ assert (locked == 0);
> + mutex_lock (&av->mutex);
> + locked = 1;
> + chunk_at_offset (p, size)->size <= 2 * SIZE_SZ
> + || chunksize (chunk_at_offset (p, size)) >= av->system_mem; }))
If Allan is OK with it, this bit should be rewritten (as a separate
change). Unsuspecting eyes could spontaneously catch fire on reading
this :/
>
> /*
> - Consolidate other non-mmapped chunks as they arrive.
> - */
> + Consolidate other non-mmapped chunks as they arrive.
> + */
This comment should be written in a single line.
> + /* consolidate forward */
/* Consolidate forward. */
> +
> + /*
> + Place the chunk in unsorted chunk list. Chunks are
> + not placed into regular bins until after they have
> + been given one chance to be used in malloc.
> + */
The formatting is wrong here.
>
> - /*
> - If freeing a large space, consolidate possibly-surrounding
> - chunks. Then, if the total unused topmost memory exceeds trim
> - threshold, ask malloc_trim to reduce top.
> + /*
> + If the chunk borders the current high end of memory,
> + consolidate into top
> + */
>
Likewise. There are multiple instances of this type.
Siddhesh