I have to implement an optimized version of malloc/realloc/free (tailored for my particular application). At the moment the code runs on a particular platform, but I would l
Alignment features are only handled in the new C standard, C11. It has keywords _Alignof
, _Alignas
and a function aligned_alloc
. Theses features are not very difficult to emulate with most modern compilers (as indicated in other answers), so I'd suggest you write yourself small macros or wrappers that you'd use depending on __STDC_VERSION__
.