Patchwork malloc: Revert sense of prev_inuse in comments

login
register
mail settings
Submitter Florian Weimer
Date March 9, 2018, 12:36 p.m.
Message ID <20180309123632.0D4364026C8B1@oldenburg.str.redhat.com>
Download mbox | patch
Permalink /patch/26248/
State New
Headers show

Comments

Florian Weimer - March 9, 2018, 12:36 p.m.
2018-03-09  Florian Weimer  <fweimer@redhat.com>

	* malloc/malloc.c (prev_size, set_prev_size, prev_chunk): Fix typo
	in comment.
Carlos O'Donell - March 9, 2018, 3:19 p.m.
On 03/09/2018 06:36 AM, Florian Weimer wrote:
> 2018-03-09  Florian Weimer  <fweimer@redhat.com>
> 
> 	* malloc/malloc.c (prev_size, set_prev_size, prev_chunk): Fix typo
> 	in comment.

LGTM.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>

> diff --git a/malloc/malloc.c b/malloc/malloc.c
> index 58f9acd4d1..e229181c5e 100644
> --- a/malloc/malloc.c
> +++ b/malloc/malloc.c
> @@ -1287,13 +1287,13 @@ nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
>  /* Ptr to next physical malloc_chunk. */
>  #define next_chunk(p) ((mchunkptr) (((char *) (p)) + chunksize (p)))
>  
> -/* Size of the chunk below P.  Only valid if prev_inuse (P).  */
> +/* Size of the chunk below P.  Only valid if !prev_inuse (P).  */
>  #define prev_size(p) ((p)->mchunk_prev_size)
>  
> -/* Set the size of the chunk below P.  Only valid if prev_inuse (P).  */
> +/* Set the size of the chunk below P.  Only valid if !prev_inuse (P).  */
>  #define set_prev_size(p, sz) ((p)->mchunk_prev_size = (sz))
>  
> -/* Ptr to previous physical malloc_chunk.  Only valid if prev_inuse (P).  */
> +/* Ptr to previous physical malloc_chunk.  Only valid if !prev_inuse (P).  */
>  #define prev_chunk(p) ((mchunkptr) (((char *) (p)) - prev_size (p)))
>  
>  /* Treat space at ptr + offset as a chunk */
>

Patch

diff --git a/malloc/malloc.c b/malloc/malloc.c
index 58f9acd4d1..e229181c5e 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -1287,13 +1287,13 @@  nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 /* Ptr to next physical malloc_chunk. */
 #define next_chunk(p) ((mchunkptr) (((char *) (p)) + chunksize (p)))
 
-/* Size of the chunk below P.  Only valid if prev_inuse (P).  */
+/* Size of the chunk below P.  Only valid if !prev_inuse (P).  */
 #define prev_size(p) ((p)->mchunk_prev_size)
 
-/* Set the size of the chunk below P.  Only valid if prev_inuse (P).  */
+/* Set the size of the chunk below P.  Only valid if !prev_inuse (P).  */
 #define set_prev_size(p, sz) ((p)->mchunk_prev_size = (sz))
 
-/* Ptr to previous physical malloc_chunk.  Only valid if prev_inuse (P).  */
+/* Ptr to previous physical malloc_chunk.  Only valid if !prev_inuse (P).  */
 #define prev_chunk(p) ((mchunkptr) (((char *) (p)) - prev_size (p)))
 
 /* Treat space at ptr + offset as a chunk */