]> git.ipfire.org Git - thirdparty/knot-resolver.git/commit
daemon: use __attribute__((constructor)) for protolayer_globals docs-develop-prot-614eod/deployments/4380
authorOto Šťáva <oto.stava@nic.cz>
Tue, 18 Jun 2024 15:18:37 +0000 (17:18 +0200)
committerOto Šťáva <oto.stava@nic.cz>
Tue, 18 Jun 2024 15:18:37 +0000 (17:18 +0200)
commitead0fed0bce014b5268ce9c67942618c9cc9de6f
treef9c95454afb6a93ed131f75a57cab31831f803c7
parentbaacbea789646d513fe1e303e5f80651d9eb619e
daemon: use __attribute__((constructor)) for protolayer_globals

The `protolayer_globals` array can basically be treated as a constant by
most of the program and its initialization only uses compile-time-known
values.  We basically only initialize parts of the array in different
files throughout the codebase to maintain separation of concerns, so
that each piece of Knot Resolver initializes the part that pertains to
it.  Therefore, I believe that it is more ergonomic to just use
`__attribute__((constructor))` for these functions, so as not to pollute
`daemon/main.c` with these calls.
daemon/http.c
daemon/http.h [deleted file]
daemon/io.c
daemon/io.h
daemon/main.c
daemon/proxyv2.c
daemon/proxyv2.h
daemon/tls.c
daemon/tls.h
daemon/worker.c