| 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 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 PartitionBucket* bucket = root->bucketLookups[(order << kGenericNumBucketsPe
rOrderBits) + orderIndex + !!subOrderIndex]; | 727 PartitionBucket* bucket = root->bucketLookups[(order << kGenericNumBucketsPe
rOrderBits) + orderIndex + !!subOrderIndex]; |
| 728 ASSERT(!bucket->slotSize || bucket->slotSize >= size); | 728 ASSERT(!bucket->slotSize || bucket->slotSize >= size); |
| 729 ASSERT(!(bucket->slotSize % kGenericSmallestBucket)); | 729 ASSERT(!(bucket->slotSize % kGenericSmallestBucket)); |
| 730 return bucket; | 730 return bucket; |
| 731 } | 731 } |
| 732 | 732 |
| 733 ALWAYS_INLINE void* partitionAllocGenericFlags(PartitionRootGeneric* root, int f
lags, size_t size, const char* typeName) | 733 ALWAYS_INLINE void* partitionAllocGenericFlags(PartitionRootGeneric* root, int f
lags, size_t size, const char* typeName) |
| 734 { | 734 { |
| 735 #if defined(MEMORY_TOOL_REPLACES_ALLOCATOR) | 735 #if defined(MEMORY_TOOL_REPLACES_ALLOCATOR) |
| 736 void* result = malloc(size); | 736 void* result = malloc(size); |
| 737 RELEASE_ASSERT(result); | 737 RELEASE_ASSERT(result || flags & PartitionAllocReturnNull); |
| 738 return result; | 738 return result; |
| 739 #else | 739 #else |
| 740 ASSERT(root->initialized); | 740 ASSERT(root->initialized); |
| 741 size_t requestedSize = size; | 741 size_t requestedSize = size; |
| 742 size = partitionCookieSizeAdjustAdd(size); | 742 size = partitionCookieSizeAdjustAdd(size); |
| 743 PartitionBucket* bucket = partitionGenericSizeToBucket(root, size); | 743 PartitionBucket* bucket = partitionGenericSizeToBucket(root, size); |
| 744 void* ret = nullptr; | 744 void* ret = nullptr; |
| 745 { | 745 { |
| 746 SpinLock::Guard guard(root->lock); | 746 SpinLock::Guard guard(root->lock); |
| 747 // TODO(bashi): Remove following RELEAE_ASSERT()s once we find the cause
of | 747 // TODO(bashi): Remove following RELEAE_ASSERT()s once we find the cause
of |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 869 using WTF::partitionAlloc; | 869 using WTF::partitionAlloc; |
| 870 using WTF::partitionFree; | 870 using WTF::partitionFree; |
| 871 using WTF::partitionAllocGeneric; | 871 using WTF::partitionAllocGeneric; |
| 872 using WTF::partitionFreeGeneric; | 872 using WTF::partitionFreeGeneric; |
| 873 using WTF::partitionReallocGeneric; | 873 using WTF::partitionReallocGeneric; |
| 874 using WTF::partitionAllocActualSize; | 874 using WTF::partitionAllocActualSize; |
| 875 using WTF::partitionAllocSupportsGetSize; | 875 using WTF::partitionAllocSupportsGetSize; |
| 876 using WTF::partitionAllocGetSize; | 876 using WTF::partitionAllocGetSize; |
| 877 | 877 |
| 878 #endif // WTF_PartitionAlloc_h | 878 #endif // WTF_PartitionAlloc_h |
| OLD | NEW |