summaryrefslogtreecommitdiffstats
path: root/daemon/defer.c
diff options
context:
space:
mode:
authorVladimír Čunát <vladimir.cunat@nic.cz>2024-06-14 11:12:16 +0200
committerVladimír Čunát <vladimir.cunat@nic.cz>2024-06-14 11:12:16 +0200
commitcce4acea89d6ae08dfc79e9c93b66b2a09834abd (patch)
treef4aa998704d2347eef2bbd9697fff3d2c0c23956 /daemon/defer.c
parentdefer: add new KRU instance and async queues (diff)
downloadknot-resolver-cce4acea89d6ae08dfc79e9c93b66b2a09834abd.tar.xz
knot-resolver-cce4acea89d6ae08dfc79e9c93b66b2a09834abd.zip
treewide: utilize _Alignas, as it's standard C11
Diffstat (limited to 'daemon/defer.c')
-rw-r--r--daemon/defer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/daemon/defer.c b/daemon/defer.c
index 5d0ad222..7c09751c 100644
--- a/daemon/defer.c
+++ b/daemon/defer.c
@@ -24,7 +24,7 @@ struct defer {
size_t capacity;
kru_price_t max_decay;
bool using_avx2;
- uint8_t kru[] ALIGNED(64);
+ _Alignas(64) uint8_t kru[];
};
struct defer *defer = NULL;
struct mmapped defer_mmapped = {0};
@@ -46,7 +46,7 @@ static bool using_avx2(void)
/// Increment KRU counters by given time.
void defer_account(uint64_t nsec, union kr_sockaddr addr) {
- uint8_t key[16] ALIGNED(16) = {0, };
+ _Alignas(16) uint8_t key[16] = {0, };
uint16_t max_load = 0;
if (defer_sample_state.addr.ip.sa_family == AF_INET6) {
struct sockaddr_in6 *ipv6 = (struct sockaddr_in6 *)&defer_sample_state.addr.ip;
@@ -86,7 +86,7 @@ static enum protolayer_iter_cb_result pl_defer_unwrap(
defer_sample_addr((const union kr_sockaddr *)ctx->comm->comm_addr);
- uint8_t key[16] ALIGNED(16) = {0, };
+ _Alignas(16) uint8_t key[16] = {0, };
uint16_t max_load = 0;
if (ctx->comm->comm_addr->sa_family == AF_INET6) {
struct sockaddr_in6 *ipv6 = (struct sockaddr_in6 *)ctx->comm->comm_addr;