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" | |
36 | 35 |
37 #ifndef NDEBUG | 36 #ifndef NDEBUG |
38 #include "wtf/MainThread.h" | 37 #include "wtf/MainThread.h" |
39 #endif | 38 #endif |
40 | 39 |
41 namespace WTF { | 40 namespace WTF { |
42 | 41 |
43 extern void initializeThreading(); | 42 extern void initializeThreading(); |
44 | 43 |
45 PartitionAllocator<4096> Partitions::m_bufferAllocator; | |
46 | |
47 void initialize(TimeFunction currentTimeFunction, TimeFunction monotonicallyIncr
easingTimeFunction) | 44 void initialize(TimeFunction currentTimeFunction, TimeFunction monotonicallyIncr
easingTimeFunction) |
48 { | 45 { |
49 QuantizedAllocation::init(); | |
50 Partitions::initialize(); | 46 Partitions::initialize(); |
51 setCurrentTimeFunction(currentTimeFunction); | 47 setCurrentTimeFunction(currentTimeFunction); |
52 setMonotonicallyIncreasingTimeFunction(monotonicallyIncreasingTimeFunction); | 48 setMonotonicallyIncreasingTimeFunction(monotonicallyIncreasingTimeFunction); |
53 initializeThreading(); | 49 initializeThreading(); |
54 } | 50 } |
55 | 51 |
56 void shutdown() | 52 void shutdown() |
57 { | 53 { |
58 Partitions::shutdown(); | 54 Partitions::shutdown(); |
59 } | 55 } |
60 | 56 |
61 void Partitions::initialize() | 57 void Partitions::initialize() |
62 { | 58 { |
63 m_bufferAllocator.init(); | 59 m_bufferAllocator.init(); |
64 } | 60 } |
65 | 61 |
66 void Partitions::shutdown() | 62 void Partitions::shutdown() |
67 { | 63 { |
68 m_bufferAllocator.shutdown(); | 64 m_bufferAllocator.shutdown(); |
69 } | 65 } |
70 | 66 |
| 67 PartitionAllocator<4096> Partitions::m_bufferAllocator; |
| 68 |
71 } // namespace WTF | 69 } // namespace WTF |
OLD | NEW |