Clangformat
This commit is contained in:
@@ -1070,8 +1070,7 @@ namespace snmalloc
|
||||
bool was_full = super->is_full();
|
||||
SlabList* sl = &small_classes[sizeclass];
|
||||
Slab* slab = Metaslab::get_slab(p);
|
||||
Superslab::Action a =
|
||||
slab->dealloc_slow(sl, super, p);
|
||||
Superslab::Action a = slab->dealloc_slow(sl, super, p);
|
||||
if (likely(a == Superslab::NoSlabReturn))
|
||||
return;
|
||||
stats().sizeclass_dealloc_slab(sizeclass);
|
||||
|
||||
@@ -124,7 +124,7 @@ namespace snmalloc
|
||||
|
||||
void push_space(address_t start, size_t large_class)
|
||||
{
|
||||
void * p = pointer_cast<void>(start);
|
||||
void* p = pointer_cast<void>(start);
|
||||
if (large_class > 0)
|
||||
PAL::template notify_using<YesZero>(p, OS_PAGE_SIZE);
|
||||
else
|
||||
@@ -249,7 +249,7 @@ namespace snmalloc
|
||||
PAL::notify_not_using(pointer_cast<void>(end), p1 - end);
|
||||
}
|
||||
|
||||
for (; end < bits::align_down(p1,align); end += size)
|
||||
for (; end < bits::align_down(p1, align); end += size)
|
||||
{
|
||||
push_space(end, large_class);
|
||||
}
|
||||
@@ -409,13 +409,14 @@ namespace snmalloc
|
||||
}
|
||||
|
||||
// Cross-reference largealloc's alloc() decommitted condition.
|
||||
if ((decommit_strategy != DecommitNone)
|
||||
&& (large_class != 0 || decommit_strategy == DecommitSuper))
|
||||
if (
|
||||
(decommit_strategy != DecommitNone) &&
|
||||
(large_class != 0 || decommit_strategy == DecommitSuper))
|
||||
{
|
||||
size_t rsize = bits::one_at_bit(SUPERSLAB_BITS) << large_class;
|
||||
|
||||
memory_provider.notify_not_using(
|
||||
pointer_offset(p, OS_PAGE_SIZE), rsize - OS_PAGE_SIZE);
|
||||
pointer_offset(p, OS_PAGE_SIZE), rsize - OS_PAGE_SIZE);
|
||||
}
|
||||
|
||||
stats.superslab_push();
|
||||
|
||||
@@ -178,8 +178,8 @@ namespace snmalloc
|
||||
// This does not need to remove the "use" as done by the fast path.
|
||||
// Returns a complex return code for managing the superslab meta data.
|
||||
// i.e. This deallocation could make an entire superslab free.
|
||||
SNMALLOC_SLOW_PATH typename Superslab::Action dealloc_slow(
|
||||
SlabList* sl, Superslab* super, void* p)
|
||||
SNMALLOC_SLOW_PATH typename Superslab::Action
|
||||
dealloc_slow(SlabList* sl, Superslab* super, void* p)
|
||||
{
|
||||
Metaslab& meta = super->get_meta(this);
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace snmalloc
|
||||
{
|
||||
if (kind != Fresh)
|
||||
{
|
||||
// If this wasn't previously Fresh, we need to zero some things.
|
||||
// If this wasn't previously Fresh, we need to zero some things.
|
||||
used = 0;
|
||||
for (size_t i = 0; i < SLAB_COUNT; i++)
|
||||
{
|
||||
@@ -105,7 +105,8 @@ namespace snmalloc
|
||||
{
|
||||
curr = (curr + meta[curr].next + 1) & (SLAB_COUNT - 1);
|
||||
}
|
||||
if (curr != 0) abort();
|
||||
if (curr != 0)
|
||||
abort();
|
||||
|
||||
for (size_t i = 0; i < SLAB_COUNT; i++)
|
||||
{
|
||||
|
||||
@@ -107,8 +107,7 @@ extern "C"
|
||||
SNMALLOC_EXPORT void*
|
||||
SNMALLOC_NAME_MANGLE(memalign)(size_t alignment, size_t size)
|
||||
{
|
||||
if (
|
||||
(alignment == 0) || (alignment == size_t(-1)))
|
||||
if ((alignment == 0) || (alignment == size_t(-1)))
|
||||
{
|
||||
errno = EINVAL;
|
||||
return nullptr;
|
||||
|
||||
@@ -83,7 +83,6 @@ namespace snmalloc
|
||||
UNUSED(p);
|
||||
UNUSED(size);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -108,7 +108,8 @@ int main(int argc, char** argv)
|
||||
test_posix_memalign((size_t)-1, 0, EINVAL, true);
|
||||
test_posix_memalign(OS_PAGE_SIZE, sizeof(uintptr_t) / 2, EINVAL, true);
|
||||
|
||||
for (size_t align = sizeof(uintptr_t); align <= SUPERSLAB_SIZE * 8; align <<= 1)
|
||||
for (size_t align = sizeof(uintptr_t); align <= SUPERSLAB_SIZE * 8;
|
||||
align <<= 1)
|
||||
{
|
||||
for (snmalloc::sizeclass_t sc = 0; sc < NUM_SIZECLASSES; sc++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user