]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Use alignas() from stdatomics to align 12578/head
authorOndřej Surý <ondrej@isc.org>
Thu, 13 Aug 2026 11:55:22 +0000 (13:55 +0200)
committerOndřej Surý <ondrej@isc.org>
Thu, 13 Aug 2026 18:11:56 +0000 (20:11 +0200)
This is a followup to !12513 that missed two fixup commits that changed
__attribute__((__aligned__(N))) to alignas()

lib/dns/qpzone.c
lib/dns/zone_p.h

index bf5f38633b935790fd60f651fe52e6d3f707719c..e474f843c2ea077c796db5578af50549435b27fd 100644 (file)
@@ -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
index 90768fcdc4350383adf3400c24450a7d2417c9ab..2cc6d4d693b1da1ff896ba6fc3a087d56ee47fb6 100644 (file)
@@ -15,6 +15,7 @@
 
 /*! \file */
 
+#include <stdalign.h>
 #include <stdbool.h>
 
 #include <isc/os.h>
@@ -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;