From 333190a27de43773728b2bf2811ef8bdb0ef8b7a Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Fri, 29 May 2020 17:12:00 +0100 Subject: [PATCH] Add some default initialisers. (#207) * Add some default initialisers. --- src/mem/alloc.h | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/mem/alloc.h b/src/mem/alloc.h index b568cbce5..74380d1d7 100644 --- a/src/mem/alloc.h +++ b/src/mem/alloc.h @@ -17,6 +17,7 @@ #include "sizeclasstable.h" #include "slab.h" +#include #include namespace snmalloc @@ -513,14 +514,9 @@ namespace snmalloc * A stub Remote object that will always be the head of this list; * never taken for further processing. */ - Remote head; + Remote head{}; - Remote* last; - - RemoteList() - { - clear(); - } + Remote* last{&head}; void clear() { @@ -543,8 +539,8 @@ namespace snmalloc * need to dispatch everything, we can check if we are a real allocator * and lazily provide a real allocator. */ - int64_t capacity = 0; - RemoteList list[REMOTE_SLOTS]; + int64_t capacity{0}; + std::array list{}; /// Used to find the index into the array of queues for remote /// deallocation