Add ConcurrencySafe property

Ranges can be safe to call from multiple threads.  This adds a constexpr
field to signify if that is the case.
This commit is contained in:
Matthew Parkinson
2022-03-23 16:15:57 +00:00
committed by Matthew Parkinson
parent bdb3183989
commit e77b9e2851
10 changed files with 24 additions and 0 deletions

View File

@@ -235,6 +235,9 @@ namespace snmalloc
}
else
{
static_assert(
GlobalMetaRange::ConcurrencySafe,
"Global meta data range needs to be concurrency safe.");
typename GlobalMetaRange::State global_state;
p = global_state->alloc_range(bits::next_pow2(size));
}