You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running clang-tidy with the altera-struct-pack-align there are a number of warnings about alignment and packing that are printed out. We should investigate the performance impact and memory impacts of following these recommendations.
Example output
/home/ec2-user/workspace/s2n-tls/utils/s2n_random.c:99:8: warning: accessing fields in struct 's2n_rand_state' is inefficient due to padding; only needs 89 bytes but is using 96 bytes [altera-struct-pack-align]
struct s2n_rand_state {
^
/home/ec2-user/workspace/s2n-tls/utils/s2n_random.c:99:8: note: use "__attribute__((packed))" to reduce the amount of padding applied to struct 's2n_rand_state'
/home/ec2-user/workspace/s2n-tls/utils/s2n_random.c:99:8: warning: accessing fields in struct 's2n_rand_state' is inefficient due to poor alignment; currently aligned to 8 bytes, but recommended alignment is 128 bytes [altera-struct-pack-align]
struct s2n_rand_state {
Solution:
I'm not totally certain of the interaction between packed and alignment. More investigation is needed.
The text was updated successfully, but these errors were encountered:
jmayclin
changed the title
Consider using __attribute__((packed)) for opaque and internal structs
Investigate packing and alignment for internal/opaque structs
Apr 18, 2024
Problem:
When running clang-tidy with the
altera-struct-pack-align
there are a number of warnings about alignment and packing that are printed out. We should investigate the performance impact and memory impacts of following these recommendations.Example output
Solution:
I'm not totally certain of the interaction between
packed
andalignment
. More investigation is needed.The text was updated successfully, but these errors were encountered: