[cfe-users] Writing an debug memory allocator compatible with -fcatch-undefined-behavior

Thomas Engelmeier tengelmeier at blackberry.com
Fri Feb 7 06:27:04 PST 2014


On 07.02.14 13:41, "Dmitri Gribenko" <gribozavr at gmail.com> wrote:


>On Fri, Feb 7, 2014 at 12:22 PM, Thomas Engelmeier
><tengelmeier at blackberry.com> wrote:
>> typedef struct {
>>  unsigned size;
>>  char mem[1];
>> } My_MemoryBlockHeader_t;
>
>'mem' should be aligned at least as strictly as the maximum-aligned on
>the platform.

Thanks, that + using size_t instead of unsigned int fixed the exception!





More information about the cfe-users mailing list