Home | History | Annotate | Download | only in src

Lines Matching refs:Static

129 #include "static_vars.h"       // for Static
177 using tcmalloc::Static;
280 static int tc_new_mode = 0; // See tc_set_new_mode().
315 static void ExtractStats(TCMallocStats* r, uint64_t* class_count,
321 const int length = Static::central_cache()[cl].length();
322 const int tc_length = Static::central_cache()[cl].tc_length();
323 const size_t cache_overhead = Static::central_cache()[cl].OverheadBytes();
325 Static::sizemap()->ByteSizeForClass(cl));
334 SpinLockHolder h(Static::pageheap_lock());
337 r->pageheap = Static::pageheap()->stats();
339 Static::pageheap()->GetSmallSpanStats(small_spans);
342 Static::pageheap()->GetLargeSpanStats(large_spans);
347 static double PagesToMiB(uint64_t pages) {
352 static void DumpStats(TCMalloc_Printer* out, int level) {
363 static const double MiB = 1048576.0;
411 uint64_t(Static::span_allocator()->inuse()),
423 class_count[cl] * Static::sizemap()->ByteSizeForClass(cl);
427 cl, Static::sizemap()->ByteSizeForClass(cl),
479 static void PrintStats(int level) {
488 static void** DumpHeapGrowthStackTraces() {
492 SpinLockHolder h(Static::pageheap_lock());
493 for (StackTrace* t = Static::growth_stacks();
511 SpinLockHolder h(Static::pageheap_lock());
513 for (StackTrace* t = Static::growth_stacks();
535 static void IterateOverRanges(void* arg, MallocExtension::RangeFunction func) {
540 static const int kNumRanges = 16;
541 static base::MallocRange ranges[kNumRanges];
544 SpinLockHolder h(Static::pageheap_lock());
546 if (!Static::pageheap()->GetNextRange(page, &ranges[n])) {
571 // NOTE: Protected by Static::pageheap_lock().
610 SpinLockHolder h(Static::pageheap_lock());
611 Span* sampled = Static::sampled_objects();
653 SpinLockHolder l(Static::pageheap_lock());
654 PageHeap::Stats stats = Static::pageheap()->stats();
681 SpinLockHolder l(Static::pageheap_lock());
682 *value = Static::pageheap()->stats().free_bytes;
687 SpinLockHolder l(Static::pageheap_lock());
688 *value = Static::pageheap()->stats().unmapped_bytes;
693 SpinLockHolder l(Static::pageheap_lock());
712 SpinLockHolder l(Static::pageheap_lock());
727 SpinLockHolder h(Static::pageheap_lock());
732 SpinLockHolder h(Static::pageheap_lock());
737 SpinLockHolder h(Static::pageheap_lock());
749 size_t bytes_released = Static::pageheap()->ReleaseAtLeastNPages(
770 const size_t cl = Static::sizemap()->SizeClass(size);
771 const size_t alloc_size = Static::sizemap()->ByteSizeForClass(cl);
794 size_t cl = Static::pageheap()->GetSizeClassIfCached(p);
798 const Span *span = Static::pageheap()->GetDescriptor(p);
803 static const char* kCentralCacheType = "tcmalloc.central";
804 static const char* kTransferCacheType = "tcmalloc.transfer";
805 static const char* kThreadCacheType = "tcmalloc.thread";
806 static const char* kPageHeapType = "tcmalloc.page";
807 static const char* kPageHeapUnmappedType = "tcmalloc.page_unmapped";
808 static const char* kLargeSpanType = "tcmalloc.large";
809 static const char* kLargeUnmappedSpanType = "tcmalloc.large_unmapped";
816 size_t class_size = Static::sizemap()->ByteSizeForClass(cl);
821 Static::central_cache()[cl].length() * class_size;
827 Static::central_cache()[cl].tc_length() * class_size;
831 prev_class_size = Static::sizemap()->ByteSizeForClass(cl);
838 SpinLockHolder h(Static::pageheap_lock());
847 i.max_object_size = Static::sizemap()->ByteSizeForClass(cl);
849 Static::sizemap()->ByteSizeForClass(cl);
858 SpinLockHolder h(Static::pageheap_lock());
859 Static::pageheap()->GetSmallSpanStats(&small);
860 Static::pageheap()->GetLargeSpanStats(&large);
905 static int tcmallocguard_refcount = 0; // no lock needed: runs before main()
941 static TCMallocGuard module_enter_exit_hook;
948 static inline bool CheckCachedSizeClass(void *ptr) {
950 size_t cached_value = Static::pageheap()->GetSizeClassIfCached(p);
952 cached_value == Static::pageheap()->GetDescriptor(p)->sizeclass;
955 static inline void* CheckedMallocResult(void *result) {
960 static inline void* SpanToMallocResult(Span *span) {
961 Static::pageheap()->CacheSizeClass(span->start, 0);
966 static void* DoSampledAllocation(size_t size) {
972 SpinLockHolder h(Static::pageheap_lock());
974 Span *span = Static::pageheap()->New(tcmalloc::pages(size == 0 ? 1 : size));
980 StackTrace *stack = Static::stacktrace_allocator()->New();
988 tcmalloc::DLL_Prepend(Static::sampled_objects(), span);
997 static int64_t large_alloc_threshold =
1001 static void ReportLargeAlloc(Length num_pages, void* result) {
1005 static const int N = 1000;
1060 SpinLockHolder h(Static::pageheap_lock());
1063 SpinLockHolder h(Static::pageheap_lock());
1064 Span* span = Static::pageheap()->New(num_pages);
1081 size_t cl = Static::sizemap()->SizeClass(size);
1082 size = Static::sizemap()->class_to_size(cl);
1110 static inline ThreadCache* GetCacheIfPresent() {
1119 if (Static::pageheap() == NULL) {
1130 size_t cl = Static::pageheap()->GetSizeClassIfCached(p);
1133 span = Static::pageheap()->GetDescriptor(p);
1146 Static::pageheap()->CacheSizeClass(p, cl);
1149 ASSERT(!Static::pageheap()->GetDescriptor(p)->sample);
1156 Static::central_cache()[cl].InsertRange(ptr, ptr, 1);
1159 SpinLockHolder h(Static::pageheap_lock());
1165 Static::stacktrace_allocator()->Delete(st);
1168 Static::pageheap()->Delete(span);
1184 size_t cl = Static::pageheap()->GetSizeClassIfCached(p);
1186 return Static::sizemap()->ByteSizeForClass(cl);
1188 const Span *span = Static::pageheap()->GetDescriptor(p);
1192 Static::pageheap()->CacheSizeClass(p, span->sizeclass);
1193 return Static::sizemap()->ByteSizeForClass(span->sizeclass);
1271 if (Static::pageheap() == NULL) ThreadCache::InitModule();
1283 int cl = Static::sizemap()->SizeClass(size);
1285 ((Static::sizemap()->class_to_size(cl) & (align - 1)) != 0)) {
1290 size = Static::sizemap()->class_to_size(cl);
1296 SpinLockHolder h(Static::pageheap_lock());
1302 Span* span = Static::pageheap()->New(tcmalloc::pages(size));
1308 Span* span = Static::pageheap()->New(alloc);
1318 Span* rest = Static::pageheap()->Split(span, skip);
1319 Static::pageheap()->Delete(span);
1327 Span* trailer = Static::pageheap()->Split(span, needed);
1328 Static::pageheap()->Delete(trailer);
1371 static SpinLock set_new_handler_lock(SpinLock::LINKER_INITIALIZED);
1633 static size_t pagesize = 0;