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: [PING^2][PATCH] Reformat malloc to gnu style.


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


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