| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef BASE_ALLOCATOR_PARTITION_ALLOCATOR_PARTITION_ALLOC_H | 5 #ifndef BASE_ALLOCATOR_PARTITION_ALLOCATOR_PARTITION_ALLOC_H |
| 6 #define BASE_ALLOCATOR_PARTITION_ALLOCATOR_PARTITION_ALLOC_H | 6 #define BASE_ALLOCATOR_PARTITION_ALLOCATOR_PARTITION_ALLOC_H |
| 7 | 7 |
| 8 // DESCRIPTION | 8 // DESCRIPTION |
| 9 // partitionAlloc() / PartitionAllocGeneric() and PartitionFree() / | 9 // partitionAlloc() / PartitionAllocGeneric() and PartitionFree() / |
| 10 // PartitionFreeGeneric() are approximately analagous to malloc() and free(). | 10 // PartitionFreeGeneric() are approximately analagous to malloc() and free(). |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 // The following security properties could be investigated in the future: | 55 // The following security properties could be investigated in the future: |
| 56 // - Per-object bucketing (instead of per-size) is mostly available at the API, | 56 // - Per-object bucketing (instead of per-size) is mostly available at the API, |
| 57 // but not used yet. | 57 // but not used yet. |
| 58 // - No randomness of freelist entries or bucket position. | 58 // - No randomness of freelist entries or bucket position. |
| 59 // - Better checking for wild pointers in free(). | 59 // - Better checking for wild pointers in free(). |
| 60 // - Better freelist masking function to guarantee fault on 32-bit. | 60 // - Better freelist masking function to guarantee fault on 32-bit. |
| 61 | 61 |
| 62 #include <limits.h> | 62 #include <limits.h> |
| 63 | 63 |
| 64 #include "base/allocator/partition_allocator/page_allocator.h" | 64 #include "base/allocator/partition_allocator/page_allocator.h" |
| 65 #include "base/allocator/partition_allocator/spin_lock.h" |
| 65 #include "base/bits.h" | 66 #include "base/bits.h" |
| 66 #include "base/compiler_specific.h" | 67 #include "base/compiler_specific.h" |
| 67 #include "base/logging.h" | 68 #include "base/logging.h" |
| 68 #include "base/synchronization/spin_lock.h" | |
| 69 #include "base/sys_byteorder.h" | 69 #include "base/sys_byteorder.h" |
| 70 #include "build/build_config.h" | 70 #include "build/build_config.h" |
| 71 | 71 |
| 72 #if defined(MEMORY_TOOL_REPLACES_ALLOCATOR) | 72 #if defined(MEMORY_TOOL_REPLACES_ALLOCATOR) |
| 73 #include <stdlib.h> | 73 #include <stdlib.h> |
| 74 #endif | 74 #endif |
| 75 | 75 |
| 76 namespace base { | 76 namespace base { |
| 77 | 77 |
| 78 // Allocation granularity of sizeof(void*) bytes. | 78 // Allocation granularity of sizeof(void*) bytes. |
| (...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 896 void init() { PartitionAllocGenericInit(&partition_root_); } | 896 void init() { PartitionAllocGenericInit(&partition_root_); } |
| 897 ALWAYS_INLINE PartitionRootGeneric* root() { return &partition_root_; } | 897 ALWAYS_INLINE PartitionRootGeneric* root() { return &partition_root_; } |
| 898 | 898 |
| 899 private: | 899 private: |
| 900 PartitionRootGeneric partition_root_; | 900 PartitionRootGeneric partition_root_; |
| 901 }; | 901 }; |
| 902 | 902 |
| 903 } // namespace base | 903 } // namespace base |
| 904 | 904 |
| 905 #endif // BASE_ALLOCATOR_PARTITION_ALLOCATOR_PARTITION_ALLOC_H | 905 #endif // BASE_ALLOCATOR_PARTITION_ALLOCATOR_PARTITION_ALLOC_H |
| OLD | NEW |