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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
177 static const size_t kGenericSmallestBucket = 1 << (kGenericMinBucketedOrder - 1) ; | 177 static const size_t kGenericSmallestBucket = 1 << (kGenericMinBucketedOrder - 1) ; |
178 static const size_t kGenericMaxBucketSpacing = 1 << ((kGenericMaxBucketedOrder - 1) - kGenericNumBucketsPerOrderBits); | 178 static const size_t kGenericMaxBucketSpacing = 1 << ((kGenericMaxBucketedOrder - 1) - kGenericNumBucketsPerOrderBits); |
179 static const size_t kGenericMaxBucketed = (1 << (kGenericMaxBucketedOrder - 1)) + ((kGenericNumBucketsPerOrder - 1) * kGenericMaxBucketSpacing); | 179 static const size_t kGenericMaxBucketed = (1 << (kGenericMaxBucketedOrder - 1)) + ((kGenericNumBucketsPerOrder - 1) * kGenericMaxBucketSpacing); |
180 static const size_t kGenericMinDirectMappedDownsize = kGenericMaxBucketed + 1; / / Limit when downsizing a direct mapping using realloc(). | 180 static const size_t kGenericMinDirectMappedDownsize = kGenericMaxBucketed + 1; / / Limit when downsizing a direct mapping using realloc(). |
181 static const size_t kGenericMaxDirectMapped = INT_MAX - kSystemPageSize; | 181 static const size_t kGenericMaxDirectMapped = INT_MAX - kSystemPageSize; |
182 static const size_t kBitsPerSizet = sizeof(void*) * CHAR_BIT; | 182 static const size_t kBitsPerSizet = sizeof(void*) * CHAR_BIT; |
183 | 183 |
184 // Constants for the memory reclaim logic. | 184 // Constants for the memory reclaim logic. |
185 static const size_t kMaxFreeableSpans = 16; | 185 static const size_t kMaxFreeableSpans = 16; |
186 | 186 |
187 // If the total size of allocated but not committed pages exceeds this value, | |
Tom Sepez
2014/11/06 17:32:51
nit: size in bytes? pages?
Chris Evans
2014/11/06 20:43:22
Nit: this comment doesn't really explain why we'd
hiroshige
2014/11/07 08:57:00
In bytes. Add it to the comment.
hiroshige
2014/11/07 08:57:00
Done.
hiroshige
2014/11/07 08:57:00
Done.
| |
188 // special crash stack trace is generated at |partitionOutOfMemory|. | |
Chris Evans
2014/11/06 20:43:22
Nit: "a special"?
hiroshige
2014/11/07 08:57:00
Done.
| |
189 static const size_t kReasonableSizeOfUnusedPages = 1000000000; | |
Chris Evans
2014/11/06 20:43:22
Nit: this looks to be about 1GB. Maybe formulate i
hiroshige
2014/11/07 08:57:00
Done.
| |
190 | |
187 #if ENABLE(ASSERT) | 191 #if ENABLE(ASSERT) |
188 // These two byte values match tcmalloc. | 192 // These two byte values match tcmalloc. |
189 static const unsigned char kUninitializedByte = 0xAB; | 193 static const unsigned char kUninitializedByte = 0xAB; |
190 static const unsigned char kFreedByte = 0xCD; | 194 static const unsigned char kFreedByte = 0xCD; |
191 static const uint32_t kCookieValue = 0xDEADBEEFu; | 195 static const uint32_t kCookieValue = 0xDEADBEEFu; |
192 static const size_t kCookieSize = 16; // Handles alignment up to XMM instruction s on Intel. | 196 static const size_t kCookieSize = 16; // Handles alignment up to XMM instruction s on Intel. |
193 #endif | 197 #endif |
194 | 198 |
195 struct PartitionBucket; | 199 struct PartitionBucket; |
196 struct PartitionRootBase; | 200 struct PartitionRootBase; |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
657 using WTF::partitionAlloc; | 661 using WTF::partitionAlloc; |
658 using WTF::partitionFree; | 662 using WTF::partitionFree; |
659 using WTF::partitionAllocGeneric; | 663 using WTF::partitionAllocGeneric; |
660 using WTF::partitionFreeGeneric; | 664 using WTF::partitionFreeGeneric; |
661 using WTF::partitionReallocGeneric; | 665 using WTF::partitionReallocGeneric; |
662 using WTF::partitionAllocActualSize; | 666 using WTF::partitionAllocActualSize; |
663 using WTF::partitionAllocSupportsGetSize; | 667 using WTF::partitionAllocSupportsGetSize; |
664 using WTF::partitionAllocGetSize; | 668 using WTF::partitionAllocGetSize; |
665 | 669 |
666 #endif // WTF_PartitionAlloc_h | 670 #endif // WTF_PartitionAlloc_h |
OLD | NEW |