mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-11 14:19:59 -04:00
Move last_purge declaration under the same #ifdef as its user
The static atomic last_purge is only read and written from mem_purge(),
which is compiled only when JEMALLOC_API_SUPPORTED or __GLIBC__ is
defined. This used to fail on OpenBSD:
../lib/isc/mem.c:405:31: error: unused variable 'last_purge' [-Werror,-Wunused-variable]
405 | static _Atomic(isc_stdtime_t) last_purge = 0;
| ^~~~~~~~~~
This commit is contained in:
parent
222d86fee8
commit
075305dcc7
1 changed files with 2 additions and 1 deletions
|
|
@ -402,12 +402,13 @@ mem_get(isc_mem_t *ctx, size_t size, int flags) {
|
|||
}
|
||||
|
||||
static thread_local size_t freed_bytes = 0;
|
||||
static _Atomic(isc_stdtime_t) last_purge = 0;
|
||||
|
||||
constexpr size_t purge_threshold = (16 * 1024 * 1024);
|
||||
|
||||
#if defined(JEMALLOC_API_SUPPORTED) || defined(__GLIBC__)
|
||||
|
||||
static _Atomic(isc_stdtime_t) last_purge = 0;
|
||||
|
||||
static void
|
||||
mem_purge(void) {
|
||||
isc_stdtime_t now = isc_stdtime_now();
|
||||
|
|
|
|||
Loading…
Reference in a new issue