Home | History | Annotate | Download | only in src

Lines Matching refs:Static

129 #include "static_vars.h"       // for Static
167 using tcmalloc::Static;
171 static size_t ExcludeSpaceForMark(size_t size);
172 static void AddRoomForMark(size_t* size);
173 static void ExcludeMarkFromSize(size_t* new_size);
174 static void MarkAllocatedRegion(void* ptr);
175 static void ValidateAllocatedRegion(void* ptr, size_t cl);
280 static int tc_new_mode = 0; // See tc_set_new_mode().
327 static void ExtractStats(TCMallocStats* r, uint64_t* class_count,
333 const int length = Static::central_cache()[cl].length();
334 const int tc_length = Static::central_cache()[cl].tc_length();
335 const size_t cache_overhead = Static::central_cache()[cl].OverheadBytes();
337 Static::sizemap()->ByteSizeForClass(cl));
346 SpinLockHolder h(Static::pageheap_lock());
350 r->pageheap = Static::pageheap()->stats();
352 Static::pageheap()->GetSmallSpanStats(small_spans);
355 Static::pageheap()->GetLargeSpanStats(large_spans);
360 static double PagesToMiB(uint64_t pages) {
365 static void DumpStats(TCMalloc_Printer* out, int level) {
376 static const double MiB = 1048576.0;
442 uint64_t(Static::span_allocator()->inuse()),
454 class_count[cl] * Static::sizemap()->ByteSizeForClass(cl);
458 cl, Static::sizemap()->ByteSizeForClass(cl),
510 static void PrintStats(int level) {
519 static void** DumpHeapGrowthStackTraces() {
523 SpinLockHolder h(Static::pageheap_lock());
524 for (StackTrace* t = Static::growth_stacks();
542 SpinLockHolder h(Static::pageheap_lock());
544 for (StackTrace* t = Static::growth_stacks();
566 static void IterateOverRanges(void* arg, MallocExtension::RangeFunction func) {
571 static const int kNumRanges = 16;
572 static base::MallocRange ranges[kNumRanges];
575 SpinLockHolder h(Static::pageheap_lock());
577 if (!Static::pageheap()->GetNextRange(page, &ranges[n])) {
602 // NOTE: Protected by Static::pageheap_lock().
641 SpinLockHolder h(Static::pageheap_lock());
642 Span* sampled = Static::sampled_objects();
684 SpinLockHolder l(Static::pageheap_lock());
685 PageHeap::Stats stats = Static::pageheap()->stats();
691 SpinLockHolder l(Static::pageheap_lock());
692 *value = Static::pageheap()->stats().free_bytes;
697 SpinLockHolder l(Static::pageheap_lock());
698 *value = Static::pageheap()->stats().unmapped_bytes;
703 SpinLockHolder l(Static::pageheap_lock());
722 SpinLockHolder l(Static::pageheap_lock());
737 SpinLockHolder h(Static::pageheap_lock());
742 SpinLockHolder h(Static::pageheap_lock());
747 SpinLockHolder h(Static::pageheap_lock());
759 size_t bytes_released = Static::pageheap()->ReleaseAtLeastNPages(
780 const size_t cl = Static::sizemap()->SizeClass(size);
781 const size_t alloc_size = Static::sizemap()->ByteSizeForClass(cl);
804 size_t cl = Static::pageheap()->GetSizeClassIfCached(p);
808 const Span *span = Static::pageheap()->GetDescriptor(p);
813 static const char* kCentralCacheType = "tcmalloc.central";
814 static const char* kTransferCacheType = "tcmalloc.transfer";
815 static const char* kThreadCacheType = "tcmalloc.thread";
816 static const char* kPageHeapType = "tcmalloc.page";
817 static const char* kPageHeapUnmappedType = "tcmalloc.page_unmapped";
818 static const char* kLargeSpanType = "tcmalloc.large";
819 static const char* kLargeUnmappedSpanType = "tcmalloc.large_unmapped";
826 size_t class_size = Static::sizemap()->ByteSizeForClass(cl);
831 Static
837 Static::central_cache()[cl].tc_length() * class_size;
841 prev_class_size = Static::sizemap()->ByteSizeForClass(cl);
848 SpinLockHolder h(Static::pageheap_lock());
857 i.max_object_size = Static::sizemap()->ByteSizeForClass(cl);
859 class_count[cl] * Static::sizemap()->ByteSizeForClass(cl);
868 SpinLockHolder h(Static::pageheap_lock());
869 Static::pageheap()->GetSmallSpanStats(&small);
870 Static::pageheap()->GetLargeSpanStats(&large);
915 static int tcmallocguard_refcount = 0; // no lock needed: runs before main()
951 static TCMallocGuard module_enter_exit_hook;
958 static inline bool CheckCachedSizeClass(void *ptr) {
960 size_t cached_value = Static::pageheap()->GetSizeClassIfCached(p);
962 cached_value == Static::pageheap()->GetDescriptor(p)->sizeclass;
965 static inline void* CheckMallocResult(void *result) {
971 static inline void* SpanToMallocResult(Span *span) {
972 Static::pageheap()->CacheSizeClass(span->start, 0);
977 static void* DoSampledAllocation(size_t size) {
983 SpinLockHolder h(Static::pageheap_lock());
985 Span *span = Static::pageheap()->New(tcmalloc::pages(size == 0 ? 1 : size));
991 StackTrace *stack = Static::stacktrace_allocator()->New();
999 tcmalloc::DLL_Prepend(Static::sampled_objects(), span);
1008 static int64_t large_alloc_threshold =
1012 static void ReportLargeAlloc(Length num_pages, void* result) {
1016 static const int N = 1000;
1076 SpinLockHolder h(Static::pageheap_lock());
1079 SpinLockHolder h(Static::pageheap_lock());
1080 Span* span = Static::pageheap()->New(num_pages);
1099 size_t cl = Static::sizemap()->SizeClass(size);
1100 size = Static::sizemap()->class_to_size(cl);
1137 static inline ThreadCache* GetCacheIfPresent() {
1146 if (Static::pageheap() == NULL) {
1157 size_t cl = Static::pageheap()->GetSizeClassIfCached(p);
1160 span = Static::pageheap()->GetDescriptor(p);
1173 Static::pageheap()->CacheSizeClass(p, cl);
1187 ASSERT(!Static::pageheap()->GetDescriptor(p)->sample);
1194 Static::central_cache()[cl].InsertRange(ptr, ptr, 1);
1197 SpinLockHolder h(Static::pageheap_lock());
1203 Static::stacktrace_allocator()->Delete(st);
1206 Static::pageheap()->Delete(span);
1222 size_t cl = Static::pageheap()->GetSizeClassIfCached(p);
1224 return Static::sizemap()->ByteSizeForClass(cl);
1226 const Span *span = Static::pageheap()->GetDescriptor(p);
1230 Static::pageheap()->CacheSizeClass(p, span->sizeclass);
1231 return Static::sizemap()->ByteSizeForClass(span->sizeclass);
1316 if (Static::pageheap() == NULL) ThreadCache::InitModule();
1328 int cl = Static::sizemap()->SizeClass(size);
1330 ((Static::sizemap()->class_to_size(cl) & (align - 1)) != 0)) {
1335 size = Static::sizemap()->class_to_size(cl);
1341 SpinLockHolder h(Static::pageheap_lock());
1347 Span* span = Static::pageheap()->New(tcmalloc::pages(size));
1353 Span* span = Static::pageheap()->New(alloc);
1363 Span* rest = Static::pageheap()->Split(span, skip);
1364 Static::pageheap()->Delete(span);
1372 Span* trailer = Static::pageheap()->Split(span, needed);
1373 Static::pageheap()->Delete(trailer);
1416 static SpinLock set_new_handler_lock(SpinLock::LINKER_INITIALIZED);
1685 static size_t pagesize = 0;
1775 static size_t ExcludeSpaceForMark(size_t size) { return size; }
1776 static void AddRoomForMark(size_t* size) {}
1777 static void ExcludeMarkFromSize(size_t* new_size) {}
1778 static void MarkAllocatedRegion(void* ptr) {}
1779 static void ValidateAllocatedRegion(void* ptr, size_t cl) {}
1783 static void DieFromDoubleFree() {
1787 static void DieFromMemoryCorruption() {
1800 static const MarkType kAllocationMarkMask = static_cast<MarkType>(0x36);
1805 static const MarkType kAllocationMarkMask = static_cast<MarkType>(0xE1AB9536);
1812 inline static void AddRoomForMark(size_t* size) {
1816 inline static void ExcludeMarkFromSize(size_t* new_size) {
1820 inline static size_t ExcludeSpaceForMark(size_t size) {
1824 inline static MarkType* GetMarkLocation(void* ptr) {
1840 inline static MarkType GetMarkValue(void* ptr, MarkType* mark) {
1844 static const int kInvariantBits = 2;
1872 static void ValidateAllocatedRegion(void* ptr, size_t cl) {
1891 static void MarkAllocatedRegion(void* ptr) {