| 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 #if defined(MEMORY_TOOL_REPLACES_ALLOCATOR) | 108 #if defined(MEMORY_TOOL_REPLACES_ALLOCATOR) |
| 109 #include <stdlib.h> | 109 #include <stdlib.h> |
| 110 #endif | 110 #endif |
| 111 | 111 |
| 112 #if ENABLE(ASSERT) | 112 #if ENABLE(ASSERT) |
| 113 #include <string.h> | 113 #include <string.h> |
| 114 #endif | 114 #endif |
| 115 | 115 |
| 116 namespace WTF { | 116 namespace WTF { |
| 117 | 117 |
| 118 // Maximum size of a partition's mappings. 2046MB. Note that the total amount of | 118 // Maximum size of a partition's committed memory. 2046MB. Note that the total |
| 119 // bytes allocatable at the API will be smaller. This is because things like | 119 // amount of bytes allocatable at the API will be slightly smaller. This is |
| 120 // guard pages, metadata, page headers and wasted space come out of the total. | 120 // because things like wasted space come out of the total. The 2GB is not |
| 121 // The 2GB is not necessarily contiguous in virtual address space. | 121 // necessarily contiguous in virtual address space. |
| 122 static const size_t kMaxPartitionSize = 2046u * 1024u * 1024u; | 122 static const size_t kMaxPartitionSize = 2046u * 1024u * 1024u; |
| 123 | 123 |
| 124 // Allocation granularity of sizeof(void*) bytes. | 124 // Allocation granularity of sizeof(void*) bytes. |
| 125 static const size_t kAllocationGranularity = sizeof(void*); | 125 static const size_t kAllocationGranularity = sizeof(void*); |
| 126 static const size_t kAllocationGranularityMask = kAllocationGranularity - 1; | 126 static const size_t kAllocationGranularityMask = kAllocationGranularity - 1; |
| 127 static const size_t kBucketShift = (kAllocationGranularity == 8) ? 3 : 2; | 127 static const size_t kBucketShift = (kAllocationGranularity == 8) ? 3 : 2; |
| 128 | 128 |
| 129 // Underlying partition storage pages are a power-of-two size. It is typical | 129 // Underlying partition storage pages are a power-of-two size. It is typical |
| 130 // for a partition page to be based on multiple system pages. Most references to | 130 // for a partition page to be based on multiple system pages. Most references to |
| 131 // "page" refer to partition pages. | 131 // "page" refer to partition pages. |
| (...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 663 using WTF::partitionAlloc; | 663 using WTF::partitionAlloc; |
| 664 using WTF::partitionFree; | 664 using WTF::partitionFree; |
| 665 using WTF::partitionAllocGeneric; | 665 using WTF::partitionAllocGeneric; |
| 666 using WTF::partitionFreeGeneric; | 666 using WTF::partitionFreeGeneric; |
| 667 using WTF::partitionReallocGeneric; | 667 using WTF::partitionReallocGeneric; |
| 668 using WTF::partitionAllocActualSize; | 668 using WTF::partitionAllocActualSize; |
| 669 using WTF::partitionAllocSupportsGetSize; | 669 using WTF::partitionAllocSupportsGetSize; |
| 670 using WTF::partitionAllocGetSize; | 670 using WTF::partitionAllocGetSize; |
| 671 | 671 |
| 672 #endif // WTF_PartitionAlloc_h | 672 #endif // WTF_PartitionAlloc_h |
| OLD | NEW |