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)
Wed, Jun 10, 8:20 PM
Unknown Object (File)
Sat, May 30, 4:24 AM
Unknown Object (File)
Sat, May 30, 12:12 AM
Unknown Object (File)
Thu, May 28, 12:58 PM
Unknown Object (File)
May 21 2026, 12:59 PM
Unknown Object (File)
May 20 2026, 8:56 PM
Unknown Object (File)
May 20 2026, 12:41 PM
Unknown Object (File)
May 16 2026, 11:20 PM
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