Skip to content

Commit

Permalink
Clarify which chunk is free
Browse files Browse the repository at this point in the history
The "free"-condition of `mchunk_prev_size` and chunk pointers apply to different subjects. This was confusing for someone without prior knowledge. Properly indicating the sentence's subject should clear things up.
  • Loading branch information
Kibouo authored and DhavalKapil committed Nov 24, 2021
1 parent d778318 commit be70140
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions diving_into_glibc_heap/malloc_chunk.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ This structure represents a particular chunk of memory. The various fields have

```c
struct malloc_chunk {
INTERNAL_SIZE_T mchunk_prev_size; /* Size of previous chunk (if free). */
INTERNAL_SIZE_T mchunk_prev_size; /* Size of previous chunk, if it is free. */
INTERNAL_SIZE_T mchunk_size; /* Size in bytes, including overhead. */
struct malloc_chunk* fd; /* double links -- used only if free. */
struct malloc_chunk* fd; /* double links -- used only if this chunk is free. */
struct malloc_chunk* bk;
/* Only used for large blocks: pointer to next larger size. */
struct malloc_chunk* fd_nextsize; /* double links -- used only if free. */
struct malloc_chunk* fd_nextsize; /* double links -- used only if this chunk is free. */
struct malloc_chunk* bk_nextsize;
};

Expand Down

0 comments on commit be70140

Please sign in to comment.