Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(192)

Side by Side Diff: third_party/WebKit/Source/wtf/allocator/PartitionAlloc.h

Issue 2444913002: Revert of Add RELEASE_ASSERT() for |bucket| in partitionAllocGenericFlags() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 811 matching lines...) Expand 10 before | Expand all | Expand 10 after
822 RELEASE_ASSERT(result || flags & PartitionAllocReturnNull); 822 RELEASE_ASSERT(result || flags & PartitionAllocReturnNull);
823 return result; 823 return result;
824 #else 824 #else
825 ASSERT(root->initialized); 825 ASSERT(root->initialized);
826 size_t requestedSize = size; 826 size_t requestedSize = size;
827 size = partitionCookieSizeAdjustAdd(size); 827 size = partitionCookieSizeAdjustAdd(size);
828 PartitionBucket* bucket = partitionGenericSizeToBucket(root, size); 828 PartitionBucket* bucket = partitionGenericSizeToBucket(root, size);
829 void* ret = nullptr; 829 void* ret = nullptr;
830 { 830 {
831 SpinLock::Guard guard(root->lock); 831 SpinLock::Guard guard(root->lock);
832 // TODO(bashi): Remove following RELEAE_ASSERT()s once we find the cause of
833 // http://crbug.com/514141
834 #if OS(ANDROID)
835 RELEASE_ASSERT(bucket >= &root->buckets[0] ||
836 bucket == &PartitionRootGeneric::gPagedBucket);
837 RELEASE_ASSERT(bucket <= &root->buckets[kGenericNumBuckets - 1] ||
838 bucket == &PartitionRootGeneric::gPagedBucket);
839 RELEASE_ASSERT(root->initialized);
840 #endif
841 ret = partitionBucketAlloc(root, flags, size, bucket); 832 ret = partitionBucketAlloc(root, flags, size, bucket);
842 } 833 }
843 PartitionAllocHooks::allocationHookIfEnabled(ret, requestedSize, typeName); 834 PartitionAllocHooks::allocationHookIfEnabled(ret, requestedSize, typeName);
844 return ret; 835 return ret;
845 #endif 836 #endif
846 } 837 }
847 838
848 ALWAYS_INLINE void* partitionAllocGeneric(PartitionRootGeneric* root, 839 ALWAYS_INLINE void* partitionAllocGeneric(PartitionRootGeneric* root,
849 size_t size, 840 size_t size,
850 const char* typeName) { 841 const char* typeName) {
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
957 using WTF::partitionAlloc; 948 using WTF::partitionAlloc;
958 using WTF::partitionFree; 949 using WTF::partitionFree;
959 using WTF::partitionAllocGeneric; 950 using WTF::partitionAllocGeneric;
960 using WTF::partitionFreeGeneric; 951 using WTF::partitionFreeGeneric;
961 using WTF::partitionReallocGeneric; 952 using WTF::partitionReallocGeneric;
962 using WTF::partitionAllocActualSize; 953 using WTF::partitionAllocActualSize;
963 using WTF::partitionAllocSupportsGetSize; 954 using WTF::partitionAllocSupportsGetSize;
964 using WTF::partitionAllocGetSize; 955 using WTF::partitionAllocGetSize;
965 956
966 #endif // WTF_PartitionAlloc_h 957 #endif // WTF_PartitionAlloc_h
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698