davmac.wordpress.com davmac.wordpress.com

Custom memory allocation is not possible in standard C

I’ve recently been perusing the C’11 standard final draft, mostly hoping to find some resolutions to the various inconsistencies and problems I’ve noted previously with the C99 standard (with no real success). In particular I read section 7.22.3 (C11; 7.20.3 in C99), which discusses the malloc family of functions: The pointer returned if the allocation succeeds is suitably aligned so that it may be assigned to a pointer to any...