Skip to content

Commit

Permalink
Clang format
Browse files Browse the repository at this point in the history
  • Loading branch information
mjp41 committed Jun 12, 2024
1 parent d90c19b commit 739fae2
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/snmalloc/backend/backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ namespace snmalloc

// Calculate the extra bytes required to store the client meta-data.
size_t extra_bytes = SlabMetadata::get_extra_bytes(sizeclass);

auto meta_size = bits::next_pow2(sizeof(SlabMetadata) + extra_bytes);

#ifdef SNMALLOC_TRACING
Expand Down
9 changes: 7 additions & 2 deletions src/snmalloc/mem/backend_concept.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@ namespace snmalloc

template<typename LocalState, typename PagemapEntry, typename Backend>
concept IsBackend =
requires(LocalState& local_state, size_t size, uintptr_t ras, sizeclass_t sizeclass) {
requires(
LocalState& local_state,
size_t size,
uintptr_t ras,
sizeclass_t sizeclass) {
{
Backend::alloc_chunk(local_state, size, ras, sizeclass)
} -> ConceptSame<
Expand All @@ -116,7 +120,8 @@ namespace snmalloc
size_t size,
sizeclass_t sizeclass) {
{
Backend::dealloc_chunk(local_state, slab_metadata, alloc, size, sizeclass)
Backend::dealloc_chunk(
local_state, slab_metadata, alloc, size, sizeclass)
} -> ConceptSame<void>;
} &&
requires(address_t p) {
Expand Down
6 changes: 3 additions & 3 deletions src/snmalloc/mem/metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -622,9 +622,9 @@ namespace snmalloc
// start with.
return (get_client_storage_count(sizeclass.as_small()) - 1) *
sizeof(typename ClientMeta::StorageType);
// For large classes there is only a single entry, so this is covered by the
// existing entry in the metaslab, and further bytes are not required.

// For large classes there is only a single entry, so this is covered by
// the existing entry in the metaslab, and further bytes are not required.
return 0;
}
};
Expand Down
3 changes: 2 additions & 1 deletion src/test/func/client_meta/client_meta.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* This test performs a very simple use of the client_meta data feature in snmalloc.
* This test performs a very simple use of the client_meta data feature in
* snmalloc.
*/

#include "test/setup.h"
Expand Down
2 changes: 0 additions & 2 deletions src/test/func/miracle_ptr/miracle_ptr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ namespace snmalloc::miracle
};
} // namespace snmalloc::miracle


/**
* Overload new and delete to use the "miracle pointer" implementation.
*/
Expand All @@ -187,7 +186,6 @@ void operator delete(void* p, size_t)
snmalloc::miracle::free(p);
}


int main()
{
# ifndef SNMALLOC_PASS_THROUGH
Expand Down

0 comments on commit 739fae2

Please sign in to comment.