Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion tcmalloc/span.h
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,18 @@ class ABSL_CACHELINE_ALIGNED Span final : public SpanList::Elem {
uint16_t embed_count_;
uint16_t freelist_;
};
std::atomic<uint16_t> allocated_; // Number of non-free objects
#ifdef TCMALLOC_INTERNAL_LEGACY_LOCKING
std::atomic<uint16_t>
#else
struct {
uint16_t value;

uint16_t load(std::memory_order) const { return value; }

void store(uint16_t v, std::memory_order) { value = v; }
}
#endif
allocated_; // Number of non-free objects
#ifndef TCMALLOC_INTERNAL_LEGACY_LOCKING
uint8_t cache_size_;
#else
Expand Down
Loading