зеркало из https://github.com/microsoft/snmalloc.git
Clang format
This commit is contained in:
Родитель
cb70aa3f7f
Коммит
745a2a53d1
|
@ -32,21 +32,21 @@ namespace snmalloc
|
|||
}
|
||||
};
|
||||
|
||||
template <size_t length, typename T>
|
||||
template<size_t length, typename T>
|
||||
class ModArray
|
||||
{
|
||||
static constexpr size_t rlength = bits::next_pow2_const(length);
|
||||
T array[rlength];
|
||||
|
||||
public:
|
||||
constexpr const T &operator[] (const size_t i) const
|
||||
{
|
||||
return array[i & (rlength - 1)];
|
||||
}
|
||||
|
||||
constexpr T &operator[] (const size_t i)
|
||||
public:
|
||||
constexpr const T& operator[](const size_t i) const
|
||||
{
|
||||
return array[i & (rlength - 1)];
|
||||
}
|
||||
}
|
||||
|
||||
constexpr T& operator[](const size_t i)
|
||||
{
|
||||
return array[i & (rlength - 1)];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#pragma once
|
||||
|
||||
#include "../ds/flaglock.h"
|
||||
#include "../ds/mpmcstack.h"
|
||||
#include "../ds/helpers.h"
|
||||
#include "../ds/mpmcstack.h"
|
||||
#include "../pal/pal.h"
|
||||
#include "allocstats.h"
|
||||
#include "baseslab.h"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "superslab.h"
|
||||
#include "../ds/helpers.h"
|
||||
#include "superslab.h"
|
||||
|
||||
namespace snmalloc
|
||||
{
|
||||
|
@ -67,7 +67,7 @@ namespace snmalloc
|
|||
|
||||
constexpr static inline uint16_t medium_slab_free(uint8_t sizeclass)
|
||||
{
|
||||
return sizeclass_metadata.medium_slab_slots
|
||||
[(sizeclass - NUM_SMALL_CLASSES)];
|
||||
return sizeclass_metadata
|
||||
.medium_slab_slots[(sizeclass - NUM_SMALL_CLASSES)];
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче