Changeset 20019 in webkit for trunk/JavaScriptCore/wtf/FastMalloc.cpp
- Timestamp:
- Mar 7, 2007, 7:37:06 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/wtf/FastMalloc.cpp
r19791 r20019 66 66 #include "FastMalloc.h" 67 67 68 #include "Assertions.h" 69 68 70 #ifndef USE_SYSTEM_MALLOC 69 71 #ifndef NDEBUG … … 74 76 #endif 75 77 78 #ifndef NDEBUG 79 namespace WTF { 80 81 static bool isForbidden = false; 82 void fastMallocForbid() 83 { 84 isForbidden = true; 85 } 86 87 void fastMallocAllow() 88 { 89 isForbidden = false; 90 } 91 92 } // namespace WTF 93 #endif 94 76 95 #if USE_SYSTEM_MALLOC 77 96 … … 85 104 void *fastMalloc(size_t n) 86 105 { 106 ASSERT(!isForbidden); 87 107 return malloc(n); 88 108 } … … 90 110 void *fastCalloc(size_t n_elements, size_t element_size) 91 111 { 112 ASSERT(!isForbidden); 92 113 return calloc(n_elements, element_size); 93 114 } … … 95 116 void fastFree(void* p) 96 117 { 118 ASSERT(!isForbidden); 97 119 free(p); 98 120 } … … 100 122 void *fastRealloc(void* p, size_t n) 101 123 { 124 ASSERT(!isForbidden); 102 125 return realloc(p, n); 103 126 } … … 1881 1904 #ifdef WTF_CHANGES 1882 1905 ASSERT(isMultiThreaded || pthread_main_np()); 1906 ASSERT(!isForbidden); 1883 1907 #endif 1884 1908
Note:
See TracChangeset
for help on using the changeset viewer.