void Init() {
internal_memset(this, 0, sizeof(*this));
}
- void InitIfLinkerInitialized() {}
+ void InitLinkerInitialized() {}
void Add(AllocatorStat i, uptr v) {
v += atomic_load(&stats_[i], memory_order_relaxed);
// Global stats, used for aggregation and querying.
class AllocatorGlobalStats : public AllocatorStats {
public:
- void InitIfLinkerInitialized() {
+ void InitLinkerInitialized() {
next_ = this;
prev_ = this;
}
void Init() {
internal_memset(this, 0, sizeof(*this));
- InitIfLinkerInitialized();
+ InitLinkerInitialized();
}
void Register(AllocatorStats *s) {
template <class MapUnmapCallback = NoOpMapUnmapCallback>
class LargeMmapAllocator {
public:
- void InitIfLinkerInitialized(bool may_return_null) {
+ void InitLinkerInitialized(bool may_return_null) {
page_size_ = GetPageSizeCached();
atomic_store(&may_return_null_, may_return_null, memory_order_relaxed);
}
void Init(bool may_return_null) {
internal_memset(this, 0, sizeof(*this));
- InitIfLinkerInitialized(may_return_null);
+ InitLinkerInitialized(may_return_null);
}
void *Allocate(AllocatorStats *stat, uptr size, uptr alignment) {
atomic_store(&may_return_null_, may_return_null, memory_order_relaxed);
}
- void InitIfLinkerInitialized(bool may_return_null) {
- secondary_.InitIfLinkerInitialized(may_return_null);
- stats_.InitIfLinkerInitialized();
+ void InitLinkerInitialized(bool may_return_null) {
+ secondary_.InitLinkerInitialized(may_return_null);
+ stats_.InitLinkerInitialized();
InitCommon(may_return_null);
}