Changeset 24059 in webkit for trunk/JavaScriptCore/wtf/FastMalloc.cpp
- Timestamp:
- Jul 6, 2007, 5:09:08 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/wtf/FastMalloc.cpp
r23515 r24059 677 677 class TCMalloc_PageHeap { 678 678 public: 679 TCMalloc_PageHeap();679 void init(); 680 680 681 681 // Allocate a run of "n" pages. Returns zero if out of memory. … … 758 758 }; 759 759 760 TCMalloc_PageHeap::TCMalloc_PageHeap() : pagemap_(MetaDataAlloc), 761 free_pages_(0), 762 system_bytes_(0) { 760 void TCMalloc_PageHeap::init() 761 { 762 pagemap_.init(MetaDataAlloc); 763 free_pages_ = 0; 764 system_bytes_ = 0; 765 763 766 DLL_Init(&large_); 764 767 for (size_t i = 0; i < kMaxPages; i++) { … … 1174 1177 // Avoid extra level of indirection by making "pageheap" be just an alias 1175 1178 // of pageheap_memory. 1176 #define pageheap ((TCMalloc_PageHeap*) pageheap_memory) 1179 1180 typedef union { 1181 void* m_memory; 1182 TCMalloc_PageHeap m_pageHeap; 1183 } PageHeapUnion; 1184 1185 static inline TCMalloc_PageHeap* getPageHeap() 1186 { 1187 return &reinterpret_cast<PageHeapUnion*>(&pageheap_memory[0])->m_pageHeap; 1188 } 1189 1190 #define pageheap getPageHeap() 1177 1191 1178 1192 // Thread-specific key. Initialization here is somewhat tricky … … 1544 1558 central_cache[i].Init(i); 1545 1559 } 1546 new ((void*)pageheap_memory) TCMalloc_PageHeap;1560 pageheap->init(); 1547 1561 phinited = 1; 1548 1562 }
Note:
See TracChangeset
for help on using the changeset viewer.