Files
CMock/src
94xhn c30e6bb022 Fix CMock_Guts_MemBytesCapacity() integer underflow
CMock_Guts_MemBytesCapacity() returned sizeof(CMock_Guts_Buffer), which
is the size of the pointer variable itself (not the buffer it points
to), minus CMOCK_MEM_ALIGN_SIZE. On a typical 64-bit build this is
8 - CMOCK_MEM_ALIGN_SIZE, which underflows to a huge garbage value
whenever CMOCK_MEM_ALIGN_SIZE > sizeof(void*) (e.g. when it defaults
to sizeof(max_align_t) on C11+ toolchains).

Use CMock_Guts_BufferSize instead, which already tracks the real
buffer size (including growth via realloc under CMOCK_MEM_DYNAMIC).
This makes MemBytesCapacity() == MemBytesUsed() + MemBytesFree() by
construction, matching the two sibling accessors.
2026-07-15 05:17:12 +08:00
..
2026-07-01 14:41:56 -04:00
2020-08-06 13:26:00 -07:00