Skip to content

Commit

Permalink
Add some default initialisers. (#207)
Browse files Browse the repository at this point in the history
* Add some default initialisers.
  • Loading branch information
mjp41 authored May 29, 2020
1 parent c7736a2 commit 333190a
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/mem/alloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "sizeclasstable.h"
#include "slab.h"

#include <array>
#include <functional>

namespace snmalloc
Expand Down Expand Up @@ -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()
{
Expand All @@ -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<RemoteList, REMOTE_SLOTS> list{};

/// Used to find the index into the array of queues for remote
/// deallocation
Expand Down

0 comments on commit 333190a

Please sign in to comment.