Page MenuHomeFreeBSD

netlink: Align allocations on __max_align_t, not uint64_t.
ClosedPublic

Authored by jhb on Aug 3 2023, 5:32 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 6, 6:08 AM
Unknown Object (File)
Sat, Dec 6, 2:55 AM
Unknown Object (File)
Wed, Dec 3, 9:05 AM
Unknown Object (File)
Nov 13 2025, 2:44 AM
Unknown Object (File)
Oct 26 2025, 2:02 AM
Unknown Object (File)
Oct 23 2025, 2:00 AM
Unknown Object (File)
Aug 26 2025, 11:13 AM
Unknown Object (File)
Aug 23 2025, 6:06 AM
Subscribers

Details

Summary

uint64_t is not sufficient alignment for allocators on all platforms.
On a CHERI platform pointers require 16 byte alignment, but also if a
type contained a uint128_t or long double it would not be aligned
correctly either. C11 added max_align_t precisely to provide a
portable type for allocators to use.

Obtained from: CheriBSD
Sponsored by: DARPA

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable