diff options
author | Maria Matejka <mq@ucw.cz> | 2022-09-09 20:57:59 +0200 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2022-09-18 16:33:51 +0200 |
commit | b80823fe828a0687d4baae3c34c737d46fbf439c (patch) | |
tree | 89833602bbe291778e3de42a939efe297e9ce084 /nest/cmds.c | |
parent | 3d627d09d4da3bdc1712bde67ba62c9cfbfcedc9 (diff) |
Memory pages allocator is now a global simple lockless structure
Diffstat (limited to 'nest/cmds.c')
-rw-r--r-- | nest/cmds.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/nest/cmds.c b/nest/cmds.c index 092be48a..96a3ec91 100644 --- a/nest/cmds.c +++ b/nest/cmds.c @@ -109,7 +109,6 @@ print_size(char *dsc, struct resmem vals) extern pool *rt_table_pool; extern pool *rta_pool; -extern uint *pages_kept; void cmd_show_memory(void) @@ -121,8 +120,9 @@ cmd_show_memory(void) print_size("Protocols:", rmemsize(proto_pool)); struct resmem total = rmemsize(&root_pool); #ifdef HAVE_MMAP - print_size("Standby memory:", (struct resmem) { .overhead = page_size * *pages_kept }); - total.overhead += page_size * *pages_kept; + int pages_kept = atomic_load_explicit(&pages_kept, memory_order_relaxed); + print_size("Standby memory:", (struct resmem) { .overhead = page_size * pages_kept }); + total.overhead += page_size * pages_kept; #endif print_size("Total:", total); cli_msg(0, ""); |