| OLD | NEW |
| 1 // Copyright (c) 2005, 2007, Google Inc. | 1 // Copyright (c) 2005, 2007, Google Inc. |
| 2 // All rights reserved. | 2 // All rights reserved. |
| 3 // Copyright (C) 2005, 2006, 2007, 2008, 2009, 2011 Apple Inc. All rights reserv
ed. | 3 // Copyright (C) 2005, 2006, 2007, 2008, 2009, 2011 Apple Inc. All rights reserv
ed. |
| 4 // | 4 // |
| 5 // Redistribution and use in source and binary forms, with or without | 5 // Redistribution and use in source and binary forms, with or without |
| 6 // modification, are permitted provided that the following conditions are | 6 // modification, are permitted provided that the following conditions are |
| 7 // met: | 7 // met: |
| 8 // | 8 // |
| 9 // * Redistributions of source code must retain the above copyright | 9 // * Redistributions of source code must retain the above copyright |
| 10 // notice, this list of conditions and the following disclaimer. | 10 // notice, this list of conditions and the following disclaimer. |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 namespace WTF { | 329 namespace WTF { |
| 330 | 330 |
| 331 #define malloc fastMalloc | 331 #define malloc fastMalloc |
| 332 #define calloc fastCalloc | 332 #define calloc fastCalloc |
| 333 #define free fastFree | 333 #define free fastFree |
| 334 #define realloc fastRealloc | 334 #define realloc fastRealloc |
| 335 | 335 |
| 336 #define MESSAGE LOG_ERROR | 336 #define MESSAGE LOG_ERROR |
| 337 #define CHECK_CONDITION ASSERT | 337 #define CHECK_CONDITION ASSERT |
| 338 | 338 |
| 339 #if !OS(MACOSX) |
| 339 static const char kLLHardeningMask = 0; | 340 static const char kLLHardeningMask = 0; |
| 341 #endif |
| 342 |
| 340 template <unsigned> struct EntropySource; | 343 template <unsigned> struct EntropySource; |
| 341 template <> struct EntropySource<4> { | 344 template <> struct EntropySource<4> { |
| 342 static uint32_t value() | 345 static uint32_t value() |
| 343 { | 346 { |
| 344 #if OS(MACOSX) | 347 #if OS(MACOSX) |
| 345 return arc4random(); | 348 return arc4random(); |
| 346 #else | 349 #else |
| 347 return static_cast<uint32_t>(static_cast<uintptr_t>(currentTime() * 1000
0) ^ reinterpret_cast<uintptr_t>(&kLLHardeningMask)); | 350 return static_cast<uint32_t>(static_cast<uintptr_t>(currentTime() * 1000
0) ^ reinterpret_cast<uintptr_t>(&kLLHardeningMask)); |
| 348 #endif | 351 #endif |
| 349 } | 352 } |
| (...skipping 3501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3851 void FastMallocZone::init() | 3854 void FastMallocZone::init() |
| 3852 { | 3855 { |
| 3853 static FastMallocZone zone(pageheap, &thread_heaps, static_cast<TCMalloc_Cen
tral_FreeListPadded*>(central_cache), &span_allocator, &threadheap_allocator); | 3856 static FastMallocZone zone(pageheap, &thread_heaps, static_cast<TCMalloc_Cen
tral_FreeListPadded*>(central_cache), &span_allocator, &threadheap_allocator); |
| 3854 } | 3857 } |
| 3855 | 3858 |
| 3856 #endif // OS(MACOSX) | 3859 #endif // OS(MACOSX) |
| 3857 | 3860 |
| 3858 } // namespace WTF | 3861 } // namespace WTF |
| 3859 | 3862 |
| 3860 #endif // FORCE_SYSTEM_MALLOC | 3863 #endif // FORCE_SYSTEM_MALLOC |
| OLD | NEW |