| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "WTF.h" | 32 #include "WTF.h" |
| 33 | 33 |
| 34 #include "wtf/PartitionAlloc.h" | 34 #include "wtf/PartitionAlloc.h" |
| 35 #include "wtf/QuantizedAllocation.h" |
| 35 | 36 |
| 36 #ifndef NDEBUG | 37 #ifndef NDEBUG |
| 37 #include "wtf/MainThread.h" | 38 #include "wtf/MainThread.h" |
| 38 #endif | 39 #endif |
| 39 | 40 |
| 40 namespace WTF { | 41 namespace WTF { |
| 41 | 42 |
| 42 extern void initializeThreading(); | 43 extern void initializeThreading(); |
| 43 | 44 |
| 45 PartitionAllocator<4096> Partitions::m_bufferAllocator; |
| 46 |
| 44 void initialize(TimeFunction currentTimeFunction, TimeFunction monotonicallyIncr
easingTimeFunction) | 47 void initialize(TimeFunction currentTimeFunction, TimeFunction monotonicallyIncr
easingTimeFunction) |
| 45 { | 48 { |
| 49 QuantizedAllocation::init(); |
| 46 Partitions::initialize(); | 50 Partitions::initialize(); |
| 47 setCurrentTimeFunction(currentTimeFunction); | 51 setCurrentTimeFunction(currentTimeFunction); |
| 48 setMonotonicallyIncreasingTimeFunction(monotonicallyIncreasingTimeFunction); | 52 setMonotonicallyIncreasingTimeFunction(monotonicallyIncreasingTimeFunction); |
| 49 initializeThreading(); | 53 initializeThreading(); |
| 50 } | 54 } |
| 51 | 55 |
| 52 void shutdown() | 56 void shutdown() |
| 53 { | 57 { |
| 54 Partitions::shutdown(); | 58 Partitions::shutdown(); |
| 55 } | 59 } |
| 56 | 60 |
| 57 void Partitions::initialize() | 61 void Partitions::initialize() |
| 58 { | 62 { |
| 59 m_bufferAllocator.init(); | 63 m_bufferAllocator.init(); |
| 60 } | 64 } |
| 61 | 65 |
| 62 void Partitions::shutdown() | 66 void Partitions::shutdown() |
| 63 { | 67 { |
| 64 m_bufferAllocator.shutdown(); | 68 m_bufferAllocator.shutdown(); |
| 65 } | 69 } |
| 66 | 70 |
| 67 PartitionAllocator<4096> Partitions::m_bufferAllocator; | |
| 68 | |
| 69 } // namespace WTF | 71 } // namespace WTF |
| OLD | NEW |