From: Ondřej Surý Date: Thu, 13 Aug 2026 11:55:22 +0000 (+0200) Subject: Use alignas() from stdatomics to align X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=add1dfef0eb58d88ba09386c468a8d467dad0a12;p=thirdparty%2Fbind9.git Use alignas() from stdatomics to align This is a followup to !12513 that missed two fixup commits that changed __attribute__((__aligned__(N))) to alignas() --- diff --git a/lib/dns/qpzone.c b/lib/dns/qpzone.c index bf5f38633b9..e474f843c2e 100644 --- a/lib/dns/qpzone.c +++ b/lib/dns/qpzone.c @@ -212,9 +212,9 @@ struct qpznode { struct qpzonedb { /* Unlocked. */ - dns_db_t common; + alignas(ISC_OS_CACHELINE_SIZE) dns_db_t common; /* Locks the data in this struct */ - __attribute__((aligned(ISC_OS_CACHELINE_SIZE))) isc_rwlock_t lock; + alignas(ISC_OS_CACHELINE_SIZE) isc_rwlock_t lock; /* * NOTE: 'references' is NOT the global reference counter for diff --git a/lib/dns/zone_p.h b/lib/dns/zone_p.h index 90768fcdc43..2cc6d4d693b 100644 --- a/lib/dns/zone_p.h +++ b/lib/dns/zone_p.h @@ -15,6 +15,7 @@ /*! \file */ +#include #include #include @@ -362,20 +363,19 @@ struct dns_zonemgr { */ struct dns_zone { /* Unlocked */ - unsigned int magic; + alignas(ISC_OS_CACHELINE_SIZE) unsigned int magic; isc_mutex_t lock; #ifdef DNS_ZONE_CHECKLOCK bool locked; #endif /* ifdef DNS_ZONE_CHECKLOCK */ isc_mem_t *mctx; - __attribute__(( - aligned(ISC_OS_CACHELINE_SIZE))) isc_refcount_t references; + alignas(ISC_OS_CACHELINE_SIZE) isc_refcount_t references; char *masterfile; char *initfile; const FILE *stream; /* loading from a stream? */ ISC_LIST(dns_include_t) includes; /* Include files */ - __attribute__((aligned(ISC_OS_CACHELINE_SIZE))) isc_rwlock_t dblock; + alignas(ISC_OS_CACHELINE_SIZE) isc_rwlock_t dblock; dns_db_t *db; /* Locked by dblock */ isc_tid_t tid;