Deprecated and removed features, and other changes affecting compatibility:
- [Add deprecations, removals and changes affecting compatibility here]
+* Although malloc and related functions currently return pointers
+ aligned to alignof (max_align_t), the documentation now says future
+ versions of glibc may relax alignment requirements for small allocations.
+ For example, a future malloc (1) might return a pointer with odd
+ alignment, because no object of size 1 can have a fundamental
+ alignment greater than 1.
Changes to build and runtime requirements:
@end group
@end smallexample
-In @theglibc{}, the block that @code{malloc} gives you is guaranteed
-to be aligned so that its address is a multiple of
+In the current release of @theglibc{}, the block that @code{malloc} gives you is
+aligned so that its address is a multiple of
@code{alignof (max_align_t)}, so that it can hold object types
with any fundamental alignment and without stricter alignment specifiers.
Only rarely is any higher boundary (such as a page
boundary) necessary; for those cases, use @code{aligned_alloc} or
@code{posix_memalign} (@pxref{Aligned Memory Blocks}).
+Future releases of @theglibc{} may relax alignment for small allocations,
+so long as any object with fundamental alignment that fits in the small
+allocation will be properly aligned. For example, a future @code{malloc (1)}
+might return a pointer with odd alignment.
Note that the memory located after the end of the block is likely to be
in use for something else; perhaps a block already allocated by another