| 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 20 matching lines...) Expand all Loading... |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "wtf/Partitions.h" | 32 #include "wtf/Partitions.h" |
| 33 | 33 |
| 34 #include "wtf/Alias.h" | 34 #include "wtf/Alias.h" |
| 35 #include "wtf/DefaultAllocator.h" | 35 #include "wtf/DefaultAllocator.h" |
| 36 #include "wtf/FastMalloc.h" | 36 #include "wtf/FastMalloc.h" |
| 37 #include "wtf/MainThread.h" | 37 #include "wtf/MainThread.h" |
| 38 | 38 |
| 39 namespace WTF { | 39 namespace WTF { |
| 40 | 40 |
| 41 const char* const Partitions::kAllocatedObjectPoolName = "partition_alloc/alloca
ted_objects"; |
| 42 |
| 41 int Partitions::s_initializationLock = 0; | 43 int Partitions::s_initializationLock = 0; |
| 42 bool Partitions::s_initialized = false; | 44 bool Partitions::s_initialized = false; |
| 43 | 45 |
| 44 PartitionAllocatorGeneric Partitions::m_fastMallocAllocator; | 46 PartitionAllocatorGeneric Partitions::m_fastMallocAllocator; |
| 45 PartitionAllocatorGeneric Partitions::m_bufferAllocator; | 47 PartitionAllocatorGeneric Partitions::m_bufferAllocator; |
| 46 SizeSpecificPartitionAllocator<3328> Partitions::m_nodeAllocator; | 48 SizeSpecificPartitionAllocator<3328> Partitions::m_nodeAllocator; |
| 47 SizeSpecificPartitionAllocator<1024> Partitions::m_layoutAllocator; | 49 SizeSpecificPartitionAllocator<1024> Partitions::m_layoutAllocator; |
| 48 HistogramEnumerationFunction Partitions::m_histogramEnumeration = nullptr; | 50 HistogramEnumerationFunction Partitions::m_histogramEnumeration = nullptr; |
| 49 | 51 |
| 50 void Partitions::initialize() | 52 void Partitions::initialize() |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 if (totalUsage >= 64 * 1024 * 1024) | 206 if (totalUsage >= 64 * 1024 * 1024) |
| 205 partitionsOutOfMemoryUsing64M(); | 207 partitionsOutOfMemoryUsing64M(); |
| 206 if (totalUsage >= 32 * 1024 * 1024) | 208 if (totalUsage >= 32 * 1024 * 1024) |
| 207 partitionsOutOfMemoryUsing32M(); | 209 partitionsOutOfMemoryUsing32M(); |
| 208 if (totalUsage >= 16 * 1024 * 1024) | 210 if (totalUsage >= 16 * 1024 * 1024) |
| 209 partitionsOutOfMemoryUsing16M(); | 211 partitionsOutOfMemoryUsing16M(); |
| 210 partitionsOutOfMemoryUsingLessThan16M(); | 212 partitionsOutOfMemoryUsingLessThan16M(); |
| 211 } | 213 } |
| 212 | 214 |
| 213 } // namespace WTF | 215 } // namespace WTF |
| OLD | NEW |