Commit 490ded41 authored by Benoit Lize's avatar Benoit Lize Committed by Commit Bot

[PartitionAlloc] Annotate and group members in PartitionRoot.

Bug: 998048
Change-Id: I94a817cfeeb08233078c1727fca1ab21ee83d099
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2424161
Commit-Queue: Benoit L <lizeb@chromium.org>
Reviewed-by: default avatarChris Palmer <palmer@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#810188}
parent a50e7914
......@@ -378,21 +378,32 @@ struct BASE_EXPORT PartitionRoot {
using DirectMapExtent = internal::PartitionDirectMapExtent<thread_safe>;
using ScopedGuard = internal::ScopedGuard<thread_safe>;
internal::MaybeSpinLock<thread_safe> lock_;
// Flags accessed on fast paths.
bool with_thread_cache = false;
const bool is_thread_safe = thread_safe;
// TODO(bartekn): Consider size of added extras (cookies and/or tag, or
// nothing) instead of true|false, so that we can just add or subtract the
// size instead of having an if branch on the hot paths.
bool allow_extras;
bool initialized = false;
internal::MaybeSpinLock<thread_safe> lock_;
#if ENABLE_TAG_FOR_CHECKED_PTR2 || ENABLE_TAG_FOR_MTE_CHECKED_PTR
internal::PartitionTag current_partition_tag = 0;
#endif
#if ENABLE_TAG_FOR_MTE_CHECKED_PTR
char* next_tag_bitmap_page = nullptr;
#endif
// Bookkeeping.
// Invariant: total_size_of_committed_pages <=
// total_size_of_super_pages +
// total_size_of_direct_mapped_pages.
size_t total_size_of_committed_pages GUARDED_BY(lock_) = 0;
size_t total_size_of_super_pages GUARDED_BY(lock_) = 0;
size_t total_size_of_direct_mapped_pages GUARDED_BY(lock_) = 0;
bool is_thread_safe = thread_safe;
// TODO(bartekn): Consider size of added extras (cookies and/or tag, or
// nothing) instead of true|false, so that we can just add or subtract the
// size instead of having an if branch on the hot paths.
bool allow_extras;
bool initialized = false;
char* next_super_page = nullptr;
char* next_partition_page = nullptr;
char* next_partition_page_end = nullptr;
......@@ -401,13 +412,9 @@ struct BASE_EXPORT PartitionRoot {
DirectMapExtent* direct_map_list = nullptr;
Page* global_empty_page_ring[kMaxFreeableSpans] = {};
int16_t global_empty_page_ring_index = 0;
// Integrity check = ~reinterpret_cast<uintptr_t>(this).
uintptr_t inverted_self = 0;
#if ENABLE_TAG_FOR_CHECKED_PTR2 || ENABLE_TAG_FOR_MTE_CHECKED_PTR
internal::PartitionTag current_partition_tag = 0;
#endif
#if ENABLE_TAG_FOR_MTE_CHECKED_PTR
char* next_tag_bitmap_page = nullptr;
#endif
// The bucket lookup table lets us map a size_t to a bucket quickly.
// The trailing +1 caters for the overflow case for very large allocation
......@@ -416,6 +423,8 @@ struct BASE_EXPORT PartitionRoot {
// behavior.
static uint16_t
bucket_index_lookup[((kBitsPerSizeT + 1) * kNumBucketsPerOrder) + 1];
// Accessed on fast paths, but sizeof(Bucket) is large, so there is no real
// benefit in packing it with other members.
Bucket buckets[kNumBuckets] = {};
Bucket sentinel_bucket;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment