Displaying 2 results from an estimated 2 matches for "arena_padding".
2018 Feb 03
1
Mismatch between code comments and reality in malloc.h
...doing some deep code diving and I seem to have found a discrepancy between code comments and reality. This difference could hint at a bug or performance degradation, but I doubt it. I thought to ask to get clarification.
In syslinux/core/mem/malloc.h, the comments and definition for arena_header, ARENA_PADDING and free_arena_header are:
/*
* This structure should be a power of two. This becomes the
* alignment unit.
*/
struct arena_header {
malloc_tag_t tag;
size_t attrs; /* Bits 0..1: Type
2..3: Heap,
4..31: MSB of the size */
struct free_arena_header *next, *prev;
#ifdef D...
2018 Feb 06
0
[PATCH] syslinux/core: Remove discrepancy between code comments and compiled code in malloc.h
From: Brett Walker <brett.walker at geometry.com.au>
Remove a discrepancy between code comments and the definition for arena_header,
ARENA_PADDING and free_arena_header.
When the size of int and pointer are both 32-bits; and compiled with
DEBUG_MALLOC undefined; the following are true: sizeof(arena_header) == 16
and sizeof(free_arena_header) == 56.
To correct this, the type of _pad needs to be changed from size_t to uint8_t.
This will make...