Alignment requirements for memory management functions
https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2018/november/alignment-requirements-for-memory-management-functions/ [www.nccgroup.trust]
2018-11-17 18:57
The alignment requirements are ambiguous in how they affect small allocations (sizes less than _Alignof(max_align_t)). Some implementations interpret this sentence to require _Alignof(max_align_t)-alignment even for allocation sizes that could not hold an object with that alignment. This is referred to as the strong-alignment reading. Other implementations interpret this sentence as requiring the returned memory to be aligned only enough to accommodate those types that could inhabit the returned memory. In particular, because sizeof(T) >= _Alignof(T) for all portably defined types T, allocations with sizes smaller than _Alignof(max_align_t) need only be aligned to the largest power of two less than or equal to the requested size. This is referred to as the weak-alignment reading.