Changeset 82876 in webkit
- Timestamp:
- Apr 4, 2011 2:59:48 PM (13 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r82875 r82876 1 2011-04-04 Oliver Hunt <oliver@apple.com> 2 3 Reviewed by Geoffrey Garen. 4 5 Make malloc validation useful 6 https://bugs.webkit.org/show_bug.cgi?id=57502 7 8 This patch changes FAST_MALLOC_MATCH_VALIDATION with a general 9 corruption check that tags the beginning and end of all allocations 10 to check for write overflows and overwrites the contents of 11 memory on free in order to (hopefully) show up use-after-free issues 12 sooner. 13 14 We also turn it on by default for debug builds. 15 16 * JavaScriptCore.exp: 17 * wtf/FastMalloc.cpp: 18 (WTF::tryFastMalloc): 19 (WTF::fastMalloc): 20 (WTF::tryFastCalloc): 21 (WTF::fastCalloc): 22 (WTF::fastFree): 23 (WTF::tryFastRealloc): 24 (WTF::fastRealloc): 25 (WTF::TCMalloc_PageHeap::isScavengerSuspended): 26 (WTF::TCMalloc_PageHeap::scheduleScavenger): 27 (WTF::TCMalloc_PageHeap::suspendScavenger): 28 (WTF::TCMalloc_PageHeap::signalScavenger): 29 (WTF::TCMallocStats::malloc): 30 (WTF::TCMallocStats::free): 31 (WTF::TCMallocStats::fastCalloc): 32 (WTF::TCMallocStats::tryFastCalloc): 33 (WTF::TCMallocStats::calloc): 34 (WTF::TCMallocStats::fastRealloc): 35 (WTF::TCMallocStats::tryFastRealloc): 36 (WTF::TCMallocStats::realloc): 37 * wtf/FastMalloc.h: 38 (WTF::Internal::fastMallocValidationHeader): 39 (WTF::Internal::fastMallocValidationSuffix): 40 (WTF::Internal::fastMallocMatchValidationType): 41 (WTF::Internal::setFastMallocMatchValidationType): 42 (WTF::fastMallocMatchValidateFree): 43 (WTF::fastMallocValidate): 44 * wtf/Platform.h: 45 1 46 2011-04-04 Geoffrey Garen <ggaren@apple.com> 2 47 -
trunk/Source/JavaScriptCore/JavaScriptCore.exp
r82849 r82876 493 493 __ZN3WTF8CollatorC1EPKc 494 494 __ZN3WTF8CollatorD1Ev 495 __ZN3WTF8Internal21fastMallocMatchFailedEPv 495 496 __ZN3WTF8fastFreeEPv 496 497 __ZN3WTF8msToYearEd -
trunk/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
r82849 r82876 162 162 ?fastFree@WTF@@YAXPAX@Z 163 163 ?fastMalloc@WTF@@YAPAXI@Z 164 ?fastMallocMatchFailed@Internal@WTF@@YAXPAX@Z 164 165 ?fastMallocSize@WTF@@YAIPBX@Z 165 166 ?fastRealloc@WTF@@YAPAXPAXI@Z -
trunk/Source/JavaScriptCore/wtf/FastMalloc.cpp
r78176 r82876 162 162 namespace WTF { 163 163 164 #if ENABLE(FAST_MALLOC_MATCH_VALIDATION)165 164 166 165 namespace Internal { 167 166 #if !ENABLE(WTF_MALLOC_VALIDATION) 167 void fastMallocMatchFailed(void*); 168 #else 169 COMPILE_ASSERT(((sizeof(ValidationHeader) % sizeof(AllocAlignmentInteger)) == 0), ValidationHeader_must_produce_correct_alignment); 170 #endif 168 171 void fastMallocMatchFailed(void*) 169 172 { … … 173 176 } // namespace Internal 174 177 175 #endif176 178 177 179 void* fastZeroedMalloc(size_t n) … … 222 224 ASSERT(!isForbidden()); 223 225 224 #if ENABLE( FAST_MALLOC_MATCH_VALIDATION)225 if (std::numeric_limits<size_t>::max() - sizeof(AllocAlignmentInteger)<= n) // If overflow would occur...226 #if ENABLE(WTF_MALLOC_VALIDATION) 227 if (std::numeric_limits<size_t>::max() - Internal::ValidationBufferSize <= n) // If overflow would occur... 226 228 return 0; 227 229 228 void* result = malloc(n + sizeof(AllocAlignmentInteger));230 void* result = malloc(n + Internal::ValidationBufferSize); 229 231 if (!result) 230 232 return 0; 231 232 *static_cast<AllocAlignmentInteger*>(result) = Internal::AllocTypeMalloc; 233 result = static_cast<AllocAlignmentInteger*>(result) + 1; 234 233 Internal::ValidationHeader* header = static_cast<Internal::ValidationHeader*>(result); 234 header->m_size = n; 235 header->m_type = Internal::AllocTypeMalloc; 236 header->m_prefix = static_cast<unsigned>(Internal::ValidationPrefix); 237 result = header + 1; 238 *Internal::fastMallocValidationSuffix(result) = Internal::ValidationSuffix; 239 fastMallocValidate(result); 235 240 return result; 236 241 #else … … 243 248 ASSERT(!isForbidden()); 244 249 245 #if ENABLE( FAST_MALLOC_MATCH_VALIDATION)250 #if ENABLE(WTF_MALLOC_VALIDATION) 246 251 TryMallocReturnValue returnValue = tryFastMalloc(n); 247 252 void* result; … … 268 273 ASSERT(!isForbidden()); 269 274 270 #if ENABLE( FAST_MALLOC_MATCH_VALIDATION)275 #if ENABLE(WTF_MALLOC_VALIDATION) 271 276 size_t totalBytes = n_elements * element_size; 272 if (n_elements > 1 && element_size && (totalBytes / element_size) != n_elements || (std::numeric_limits<size_t>::max() - sizeof(AllocAlignmentInteger) <= totalBytes))277 if (n_elements > 1 && element_size && (totalBytes / element_size) != n_elements) 273 278 return 0; 274 279 275 totalBytes += sizeof(AllocAlignmentInteger);276 void* result = malloc(totalBytes);277 if (!re sult)280 TryMallocReturnValue returnValue = tryFastMalloc(totalBytes); 281 void* result; 282 if (!returnValue.getValue(result)) 278 283 return 0; 279 280 284 memset(result, 0, totalBytes); 281 *static_cast<AllocAlignmentInteger*>(result) = Internal::AllocTypeMalloc; 282 result = static_cast<AllocAlignmentInteger*>(result) + 1; 285 fastMallocValidate(result); 283 286 return result; 284 287 #else … … 291 294 ASSERT(!isForbidden()); 292 295 293 #if ENABLE( FAST_MALLOC_MATCH_VALIDATION)296 #if ENABLE(WTF_MALLOC_VALIDATION) 294 297 TryMallocReturnValue returnValue = tryFastCalloc(n_elements, element_size); 295 298 void* result; … … 316 319 ASSERT(!isForbidden()); 317 320 318 #if ENABLE( FAST_MALLOC_MATCH_VALIDATION)321 #if ENABLE(WTF_MALLOC_VALIDATION) 319 322 if (!p) 320 323 return; 321 322 AllocAlignmentInteger* header = Internal::fastMallocMatchValidationValue(p);323 if (*header != Internal::AllocTypeMalloc)324 Internal::fastMallocMatchFailed(p);324 325 fastMallocMatchValidateFree(p, Internal::AllocTypeMalloc); 326 Internal::ValidationHeader* header = Internal::fastMallocValidationHeader(p); 327 memset(p, 0xCC, header->m_size); 325 328 free(header); 326 329 #else … … 333 336 ASSERT(!isForbidden()); 334 337 335 #if ENABLE( FAST_MALLOC_MATCH_VALIDATION)338 #if ENABLE(WTF_MALLOC_VALIDATION) 336 339 if (p) { 337 if (std::numeric_limits<size_t>::max() - sizeof(AllocAlignmentInteger)<= n) // If overflow would occur...340 if (std::numeric_limits<size_t>::max() - Internal::ValidationBufferSize <= n) // If overflow would occur... 338 341 return 0; 339 AllocAlignmentInteger* header = Internal::fastMallocMatchValidationValue(p); 340 if (*header != Internal::AllocTypeMalloc) 341 Internal::fastMallocMatchFailed(p); 342 void* result = realloc(header, n + sizeof(AllocAlignmentInteger)); 342 fastMallocValidate(p); 343 Internal::ValidationHeader* result = static_cast<Internal::ValidationHeader*>(realloc(Internal::fastMallocValidationHeader(p), n + Internal::ValidationBufferSize)); 343 344 if (!result) 344 345 return 0; 345 346 // This should not be needed because the value is already there:347 // *static_cast<AllocAlignmentInteger*>(result) = Internal::AllocTypeMalloc;348 result = static_cast<AllocAlignmentInteger*>(result) + 1;346 result->m_size = n; 347 result = result + 1; 348 *fastMallocValidationSuffix(result) = Internal::ValidationSuffix; 349 fastMallocValidate(result); 349 350 return result; 350 351 } else { … … 360 361 ASSERT(!isForbidden()); 361 362 362 #if ENABLE( FAST_MALLOC_MATCH_VALIDATION)363 #if ENABLE(WTF_MALLOC_VALIDATION) 363 364 TryMallocReturnValue returnValue = tryFastRealloc(p, n); 364 365 void* result; … … 383 384 size_t fastMallocSize(const void* p) 384 385 { 385 #if OS(DARWIN) 386 #if ENABLE(WTF_MALLOC_VALIDATION) 387 return Internal::fastMallocValidationHeader(const_cast<void*>(p))->m_size; 388 #elif OS(DARWIN) 386 389 return malloc_size(p); 387 390 #elif OS(WINDOWS) && !PLATFORM(BREWMP) … … 1301 1304 #endif 1302 1305 1306 static SpinLock pageheap_lock = SPINLOCK_INITIALIZER; 1307 1303 1308 class TCMalloc_PageHeap { 1304 1309 public: … … 1527 1532 ALWAYS_INLINE bool TCMalloc_PageHeap::isScavengerSuspended() 1528 1533 { 1529 ASSERT( IsHeld(pageheap_lock));1534 ASSERT(pageheap_lock.IsHeld()); 1530 1535 return m_scavengingSuspended; 1531 1536 } … … 1533 1538 ALWAYS_INLINE void TCMalloc_PageHeap::scheduleScavenger() 1534 1539 { 1535 ASSERT( IsHeld(pageheap_lock));1540 ASSERT(pageheap_lock.IsHeld()); 1536 1541 m_scavengingSuspended = false; 1537 1542 dispatch_resume(m_scavengeTimer); … … 1545 1550 ALWAYS_INLINE void TCMalloc_PageHeap::suspendScavenger() 1546 1551 { 1547 ASSERT( IsHeld(pageheap_lock));1552 ASSERT(pageheap_lock.IsHeld()); 1548 1553 m_scavengingSuspended = true; 1549 1554 dispatch_suspend(m_scavengeTimer); … … 2438 2443 2439 2444 // Page-level allocator 2440 static SpinLock pageheap_lock = SPINLOCK_INITIALIZER;2441 2445 static AllocAlignmentInteger pageheap_memory[(sizeof(TCMalloc_PageHeap) + sizeof(AllocAlignmentInteger) - 1) / sizeof(AllocAlignmentInteger)]; 2442 2446 static bool phinited = false; … … 2476 2480 ALWAYS_INLINE void TCMalloc_PageHeap::signalScavenger() 2477 2481 { 2478 ASSERT( IsHeld(pageheap_lock));2482 ASSERT(pageheap_lock.IsHeld()); 2479 2483 if (isScavengerSuspended() && shouldScavenge()) 2480 2484 scheduleScavenger(); … … 3822 3826 #endif 3823 3827 void* malloc(size_t size) { 3824 #if ENABLE( FAST_MALLOC_MATCH_VALIDATION)3825 if (std::numeric_limits<size_t>::max() - sizeof(AllocAlignmentInteger)<= size) // If overflow would occur...3828 #if ENABLE(WTF_MALLOC_VALIDATION) 3829 if (std::numeric_limits<size_t>::max() - Internal::ValidationBufferSize <= size) // If overflow would occur... 3826 3830 return 0; 3827 size += sizeof(AllocAlignmentInteger); 3828 void* result = do_malloc(size); 3831 void* result = do_malloc(size + Internal::ValidationBufferSize); 3829 3832 if (!result) 3830 3833 return 0; 3831 3834 3832 *static_cast<AllocAlignmentInteger*>(result) = Internal::AllocTypeMalloc; 3833 result = static_cast<AllocAlignmentInteger*>(result) + 1; 3835 Internal::ValidationHeader* header = static_cast<Internal::ValidationHeader*>(result); 3836 header->m_size = size; 3837 header->m_type = Internal::AllocTypeMalloc; 3838 header->m_prefix = static_cast<unsigned>(Internal::ValidationPrefix); 3839 result = header + 1; 3840 *Internal::fastMallocValidationSuffix(result) = Internal::ValidationSuffix; 3841 fastMallocValidate(result); 3834 3842 #else 3835 3843 void* result = do_malloc(size); … … 3850 3858 #endif 3851 3859 3852 #if ENABLE( FAST_MALLOC_MATCH_VALIDATION)3860 #if ENABLE(WTF_MALLOC_VALIDATION) 3853 3861 if (!ptr) 3854 3862 return; 3855 3863 3856 AllocAlignmentInteger* header = Internal::fastMallocMatchValidationValue(ptr);3857 if (*header != Internal::AllocTypeMalloc)3858 Internal::fastMallocMatchFailed(ptr);3864 fastMallocValidate(ptr); 3865 Internal::ValidationHeader* header = Internal::fastMallocValidationHeader(ptr); 3866 memset(ptr, 0xCC, header->m_size); 3859 3867 do_free(header); 3860 3868 #else … … 3871 3879 void* fastCalloc(size_t n, size_t elem_size) 3872 3880 { 3873 return calloc<true>(n, elem_size); 3881 void* result = calloc<true>(n, elem_size); 3882 #if ENABLE(WTF_MALLOC_VALIDATION) 3883 fastMallocValidate(result); 3884 #endif 3885 return result; 3874 3886 } 3875 3887 3876 3888 TryMallocReturnValue tryFastCalloc(size_t n, size_t elem_size) 3877 3889 { 3878 return calloc<false>(n, elem_size); 3890 void* result = calloc<false>(n, elem_size); 3891 #if ENABLE(WTF_MALLOC_VALIDATION) 3892 fastMallocValidate(result); 3893 #endif 3894 return result; 3879 3895 } 3880 3896 … … 3889 3905 return 0; 3890 3906 3891 #if ENABLE(FAST_MALLOC_MATCH_VALIDATION) 3892 if (std::numeric_limits<size_t>::max() - sizeof(AllocAlignmentInteger) <= totalBytes) // If overflow would occur... 3893 return 0; 3894 3895 totalBytes += sizeof(AllocAlignmentInteger); 3896 void* result = do_malloc(totalBytes); 3907 #if ENABLE(WTF_MALLOC_VALIDATION) 3908 void* result = malloc<crashOnFailure>(totalBytes); 3897 3909 if (!result) 3898 3910 return 0; 3899 3911 3900 3912 memset(result, 0, totalBytes); 3901 *static_cast<AllocAlignmentInteger*>(result) = Internal::AllocTypeMalloc; 3902 result = static_cast<AllocAlignmentInteger*>(result) + 1; 3913 fastMallocValidate(result); 3903 3914 #else 3904 3915 void* result = do_malloc(totalBytes); … … 3935 3946 void* fastRealloc(void* old_ptr, size_t new_size) 3936 3947 { 3937 return realloc<true>(old_ptr, new_size); 3948 #if ENABLE(WTF_MALLOC_VALIDATION) 3949 fastMallocValidate(old_ptr); 3950 #endif 3951 void* result = realloc<true>(old_ptr, new_size); 3952 #if ENABLE(WTF_MALLOC_VALIDATION) 3953 fastMallocValidate(result); 3954 #endif 3955 return result; 3938 3956 } 3939 3957 3940 3958 TryMallocReturnValue tryFastRealloc(void* old_ptr, size_t new_size) 3941 3959 { 3942 return realloc<false>(old_ptr, new_size); 3960 #if ENABLE(WTF_MALLOC_VALIDATION) 3961 fastMallocValidate(old_ptr); 3962 #endif 3963 void* result = realloc<false>(old_ptr, new_size); 3964 #if ENABLE(WTF_MALLOC_VALIDATION) 3965 fastMallocValidate(result); 3966 #endif 3967 return result; 3943 3968 } 3944 3969 … … 3948 3973 void* realloc(void* old_ptr, size_t new_size) { 3949 3974 if (old_ptr == NULL) { 3950 #if ENABLE( FAST_MALLOC_MATCH_VALIDATION)3951 void* result = malloc (new_size);3975 #if ENABLE(WTF_MALLOC_VALIDATION) 3976 void* result = malloc<crashOnFailure>(new_size); 3952 3977 #else 3953 3978 void* result = do_malloc(new_size); … … 3966 3991 } 3967 3992 3968 #if ENABLE( FAST_MALLOC_MATCH_VALIDATION)3969 if (std::numeric_limits<size_t>::max() - sizeof(AllocAlignmentInteger)<= new_size) // If overflow would occur...3993 #if ENABLE(WTF_MALLOC_VALIDATION) 3994 if (std::numeric_limits<size_t>::max() - Internal::ValidationBufferSize <= new_size) // If overflow would occur... 3970 3995 return 0; 3971 new_size += sizeof(AllocAlignmentInteger); 3972 AllocAlignmentInteger* header = Internal::fastMallocMatchValidationValue(old_ptr); 3973 if (*header != Internal::AllocTypeMalloc) 3974 Internal::fastMallocMatchFailed(old_ptr); 3996 Internal::ValidationHeader* header = Internal::fastMallocValidationHeader(old_ptr); 3997 fastMallocValidate(old_ptr); 3975 3998 old_ptr = header; 3999 header->m_size = new_size; 4000 new_size += Internal::ValidationBufferSize; 3976 4001 #endif 3977 4002 … … 4012 4037 // would be small, so don't bother. 4013 4038 do_free(old_ptr); 4014 #if ENABLE(FAST_MALLOC_MATCH_VALIDATION) 4015 new_ptr = static_cast<AllocAlignmentInteger*>(new_ptr) + 1; 4039 #if ENABLE(WTF_MALLOC_VALIDATION) 4040 new_ptr = static_cast<Internal::ValidationHeader*>(new_ptr) + 1; 4041 *Internal::fastMallocValidationSuffix(new_ptr) = Internal::ValidationSuffix; 4016 4042 #endif 4017 4043 return new_ptr; 4018 4044 } else { 4019 #if ENABLE(FAST_MALLOC_MATCH_VALIDATION) 4020 old_ptr = static_cast<AllocAlignmentInteger*>(old_ptr) + 1; // Set old_ptr back to the user pointer. 4045 #if ENABLE(WTF_MALLOC_VALIDATION) 4046 old_ptr = static_cast<Internal::ValidationHeader*>(old_ptr) + 1; // Set old_ptr back to the user pointer. 4047 *Internal::fastMallocValidationSuffix(old_ptr) = Internal::ValidationSuffix; 4021 4048 #endif 4022 4049 return old_ptr; … … 4279 4306 size_t fastMallocSize(const void* ptr) 4280 4307 { 4308 #if ENABLE(WTF_MALLOC_VALIDATION) 4309 return Internal::fastMallocValidationHeader(p)->m_size; 4310 #else 4281 4311 const PageID p = reinterpret_cast<uintptr_t>(ptr) >> kPageShift; 4282 4312 Span* span = pageheap->GetDescriptorEnsureSafe(p); … … 4294 4324 4295 4325 return span->length << kPageShift; 4326 #endif 4296 4327 } 4297 4328 -
trunk/Source/JavaScriptCore/wtf/FastMalloc.h
r61544 r82876 104 104 AllocTypeNewArray // Encompasses global operator new[]. 105 105 }; 106 } 107 108 #if ENABLE(FAST_MALLOC_MATCH_VALIDATION) 106 107 enum { 108 ValidationPrefix = 0xf00df00d, 109 ValidationSuffix = 0x0badf00d 110 }; 111 112 typedef unsigned ValidationTag; 113 114 struct ValidationHeader { 115 AllocType m_type; 116 unsigned m_size; 117 ValidationTag m_prefix; 118 unsigned m_alignment; 119 }; 120 121 static const int ValidationBufferSize = sizeof(ValidationHeader) + sizeof(ValidationTag); 122 } 123 124 #if ENABLE(WTF_MALLOC_VALIDATION) 109 125 110 126 // Malloc validation is a scheme whereby a tag is attached to an … … 121 137 122 138 namespace Internal { 139 140 // Handle a detected alloc/free mismatch. By default this calls CRASH(). 141 void fastMallocMatchFailed(void* p); 142 143 inline ValidationHeader* fastMallocValidationHeader(void* p) 144 { 145 return reinterpret_cast<ValidationHeader*>(static_cast<char*>(p) - sizeof(ValidationHeader)); 146 } 147 148 inline ValidationTag* fastMallocValidationSuffix(void* p) 149 { 150 ValidationHeader* header = fastMallocValidationHeader(p); 151 if (header->m_prefix != static_cast<unsigned>(ValidationPrefix)) 152 fastMallocMatchFailed(p); 153 154 return reinterpret_cast<ValidationTag*>(static_cast<char*>(p) + header->m_size); 155 } 123 156 124 157 // Return the AllocType tag associated with the allocated block p. 125 inline AllocType fastMallocMatchValidationType(const void* p) 126 { 127 const AllocAlignmentInteger* type = static_cast<const AllocAlignmentInteger*>(p) - 1; 128 return static_cast<AllocType>(*type); 129 } 130 131 // Return the address of the AllocType tag associated with the allocated block p. 132 inline AllocAlignmentInteger* fastMallocMatchValidationValue(void* p) 133 { 134 return reinterpret_cast<AllocAlignmentInteger*>(static_cast<char*>(p) - sizeof(AllocAlignmentInteger)); 158 inline AllocType fastMallocMatchValidationType(void* p) 159 { 160 return fastMallocValidationHeader(p)->m_type; 135 161 } 136 162 … … 138 164 inline void setFastMallocMatchValidationType(void* p, AllocType allocType) 139 165 { 140 AllocAlignmentInteger* type = static_cast<AllocAlignmentInteger*>(p) - 1; 141 *type = static_cast<AllocAlignmentInteger>(allocType); 142 } 143 144 // Handle a detected alloc/free mismatch. By default this calls CRASH(). 145 void fastMallocMatchFailed(void* p); 166 fastMallocValidationHeader(p)->m_type = allocType; 167 } 146 168 147 169 } // namespace Internal … … 157 179 158 180 // This is a higher level function which is used by FastMalloc-using code. 159 inline void fastMallocMatchValidateFree(void* p, Internal::AllocType allocType)181 inline void fastMallocMatchValidateFree(void* p, Internal::AllocType) 160 182 { 161 183 if (!p) 162 184 return; 163 164 if (Internal::fastMallocMatchValidationType(p) != allocType) 165 Internal::fastMallocMatchFailed(p); 185 186 Internal::ValidationHeader* header = Internal::fastMallocValidationHeader(p); 187 if (header->m_prefix != static_cast<unsigned>(Internal::ValidationPrefix)) 188 Internal::fastMallocMatchFailed(p); 189 190 if (*Internal::fastMallocValidationSuffix(p) != Internal::ValidationSuffix) 191 Internal::fastMallocMatchFailed(p); 192 166 193 Internal::setFastMallocMatchValidationType(p, Internal::AllocTypeMalloc); // Set it to this so that fastFree thinks it's OK. 194 } 195 196 inline void fastMallocValidate(void* p) 197 { 198 if (!p) 199 return; 200 201 Internal::ValidationHeader* header = Internal::fastMallocValidationHeader(p); 202 if (header->m_prefix != static_cast<unsigned>(Internal::ValidationPrefix)) 203 Internal::fastMallocMatchFailed(p); 204 205 if (*Internal::fastMallocValidationSuffix(p) != Internal::ValidationSuffix) 206 Internal::fastMallocMatchFailed(p); 167 207 } 168 208 -
trunk/Source/JavaScriptCore/wtf/Platform.h
r82516 r82876 28 28 #ifndef WTF_Platform_h 29 29 #define WTF_Platform_h 30 #define ENABLE_JIT 0 30 31 31 32 /* ==== PLATFORM handles OS, operating environment, graphics API, and … … 876 877 /* fastMalloc match validation allows for runtime verification that 877 878 new is matched by delete, fastMalloc is matched by fastFree, etc. */ 878 #if !defined(ENABLE_FAST_MALLOC_MATCH_VALIDATION) 879 #define ENABLE_FAST_MALLOC_MATCH_VALIDATION 0 879 #if !defined(ENABLE_WTF_MALLOC_VALIDATION) 880 #ifndef NDEBUG 881 #define ENABLE_WTF_MALLOC_VALIDATION 1 882 #else 883 #define ENABLE_WTF_MALLOC_VALIDATION 0 884 #endif 880 885 #endif 881 886
Note: See TracChangeset
for help on using the changeset viewer.