You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been 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 malloc.h, the comments and definition for arena_header, ARENA_PADDING and free_arena_header are:
Which disagrees with the comments. The comments do make a lot of sense to ensure good alignment. To make the code agree with the comments (the easier option); the definition of ARENA_PADDING needs to be altered to:
This includes a reduction in the size of the padding by the unit size of the padding, i.e sizeof(size_t). Given that this is the memory sub-system, this small change could have a significant impact.
What are your thoughts?
Feedback most welcome,
Brett
The text was updated successfully, but these errors were encountered:
Hi Devs,
I've been 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 malloc.h, the comments and definition for arena_header, ARENA_PADDING and free_arena_header are:
syslinux/core/mem/malloc.h
Lines 41 to 74 in 2ea44cb
In my environment, the size of int and pointer are both 32-bits (x86 32-bits). When compiled with DEBUG_MALLOC undefined; I get
Which disagrees with the comments. The comments do make a lot of sense to ensure good alignment. To make the code agree with the comments (the easier option); the definition of ARENA_PADDING needs to be altered to:
This includes a reduction in the size of the padding by the unit size of the padding, i.e sizeof(size_t). Given that this is the memory sub-system, this small change could have a significant impact.
What are your thoughts?
Feedback most welcome,
Brett
The text was updated successfully, but these errors were encountered: