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

Dmitri Gribenko gribozavr at gmail.com
Fri Feb 7 04:41:04 PST 2014


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.

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/



More information about the cfe-users mailing list