| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 class PartitionAllocatorDummyVisitor; | 47 class PartitionAllocatorDummyVisitor; |
| 48 | 48 |
| 49 class WTF_EXPORT PartitionAllocator { | 49 class WTF_EXPORT PartitionAllocator { |
| 50 public: | 50 public: |
| 51 typedef PartitionAllocatorDummyVisitor Visitor; | 51 typedef PartitionAllocatorDummyVisitor Visitor; |
| 52 static const bool isGarbageCollected = false; | 52 static const bool isGarbageCollected = false; |
| 53 | 53 |
| 54 template<typename T> | 54 template<typename T> |
| 55 static size_t quantizedSize(size_t count) | 55 static size_t quantizedSize(size_t count) |
| 56 { | 56 { |
| 57 CHECK_LE(count, kGenericMaxDirectMapped / sizeof(T)); | 57 RELEASE_ASSERT(count <= kGenericMaxDirectMapped / sizeof(T)); |
| 58 return partitionAllocActualSize(Partitions::bufferPartition(), count * s
izeof(T)); | 58 return partitionAllocActualSize(Partitions::bufferPartition(), count * s
izeof(T)); |
| 59 } | 59 } |
| 60 template <typename T> | 60 template <typename T> |
| 61 static T* allocateVectorBacking(size_t size) | 61 static T* allocateVectorBacking(size_t size) |
| 62 { | 62 { |
| 63 return reinterpret_cast<T*>(allocateBacking(size, WTF_HEAP_PROFILER_TYPE
_NAME(T))); | 63 return reinterpret_cast<T*>(allocateBacking(size, WTF_HEAP_PROFILER_TYPE
_NAME(T))); |
| 64 } | 64 } |
| 65 template <typename T> | 65 template <typename T> |
| 66 static T* allocateExpandedVectorBacking(size_t size) | 66 static T* allocateExpandedVectorBacking(size_t size) |
| 67 { | 67 { |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 { \ | 215 { \ |
| 216 ASSERT(location); \ | 216 ASSERT(location); \ |
| 217 return location; \ | 217 return location; \ |
| 218 } \ | 218 } \ |
| 219 private: \ | 219 private: \ |
| 220 typedef int __thisIsHereToForceASemicolonAfterThisMacro | 220 typedef int __thisIsHereToForceASemicolonAfterThisMacro |
| 221 | 221 |
| 222 using WTF::PartitionAllocator; | 222 using WTF::PartitionAllocator; |
| 223 | 223 |
| 224 #endif // WTF_PartitionAllocator_h | 224 #endif // WTF_PartitionAllocator_h |
| OLD | NEW |