mirror of https://github.com/ARMmbed/mbed-os.git
Alignment of 8 is not required for additional header
malloc guarantees aligned memory. If we add an alignment here, we are adding additonal unused 4 bytes. Each allocator has its own 4/8 byte header (GGC / ARM have 4 bytes). So if user request for 8 bytes of memory stats will add 8 + allocator 8. However if we remove the alignment in stats header, allocator will consider add 4 bytes to 12 byte request and zero padding. It will be beneficial to leave the padding to allocator.pull/8062/head
parent
c8734cf62a
commit
6646323867
|
|
@ -40,10 +40,8 @@ are active, the second one (MBED_MEM_TRACING_ENABLED) will trace the first one's
|
||||||
/* Implementation of the runtime max heap usage checker */
|
/* Implementation of the runtime max heap usage checker */
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
/* Size must be a multiple of 8 to keep alignment */
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint32_t size;
|
uint32_t size;
|
||||||
uint32_t pad;
|
|
||||||
} alloc_info_t;
|
} alloc_info_t;
|
||||||
|
|
||||||
#ifdef MBED_HEAP_STATS_ENABLED
|
#ifdef MBED_HEAP_STATS_ENABLED
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue