HomeFreeBSD

LinuxKPI: add __struct_size

Description

LinuxKPI: add __struct_size

Use builtin_object_size() by default.
If
builtin_dynamic_object_size() is available use that instead.

I would hope that in a future version we can remove the conditional
checks but in order to be able to MFC this without checking all
compiler versions simply keep it this way for now.

Sponsored by: The FreeBSD Foundation (initially)
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D52077

(cherry picked from commit ff5bcb742899f8398ccb1b9e292b2e5aeeb7fedb)
(cherry picked from commit 310885b40ad256b054d65353c375b29700ee024c)

Details

Provenance
bzAuthored on Aug 18 2025, 7:53 PM
Reviewer
dumbbell
Differential Revision
D52077: LinuxKPI: add __struct_size
Parents
rG163fe10479a3: LinuxKPI: add DEFINE_LOCK_GUARD_0 for rcu
Branches
Unknown
Tags
Unknown