Skip to content

Commit

Permalink
Unconditionally call NumCPUs().
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 566675122
Change-Id: Idc9d49cb537e965c493dc5a590e1bed608789050
  • Loading branch information
ckennelly authored and copybara-github committed Sep 19, 2023
1 parent 6d26800 commit 7bfdb50
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tcmalloc/static_vars.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "tcmalloc/internal/logging.h"
#include "tcmalloc/internal/mincore.h"
#include "tcmalloc/internal/numa.h"
#include "tcmalloc/internal/sysinfo.h"
#include "tcmalloc/malloc_extension.h"
#include "tcmalloc/pagemap.h"
#include "tcmalloc/sampler.h"
Expand Down Expand Up @@ -139,6 +140,9 @@ ABSL_ATTRIBUTE_COLD ABSL_ATTRIBUTE_NOINLINE void Static::SlowInitIfNecessary() {
}

CHECK_CONDITION(sizemap_.Init(size_classes));
// Verify we can determine the number of CPUs now, since we will need it
// later for per-CPU caches and initializing the cache topology.
(void)NumCPUs();
numa_topology_.Init();
cache_topology_.Init();
sampledallocation_allocator_.Init(&arena_);
Expand Down

0 comments on commit 7bfdb50

Please sign in to comment.