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

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

Issue 1419023008: Add RELEASE_ASSERT() for |bucket| in partitionAllocGenericFlags() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 725 matching lines...) Expand 10 before | Expand all | Expand 10 after
736 { 736 {
737 #if defined(MEMORY_TOOL_REPLACES_ALLOCATOR) 737 #if defined(MEMORY_TOOL_REPLACES_ALLOCATOR)
738 void* result = malloc(size); 738 void* result = malloc(size);
739 RELEASE_ASSERT(result); 739 RELEASE_ASSERT(result);
740 return result; 740 return result;
741 #else 741 #else
742 ASSERT(root->initialized); 742 ASSERT(root->initialized);
743 size_t requestedSize = size; 743 size_t requestedSize = size;
744 size = partitionCookieSizeAdjustAdd(size); 744 size = partitionCookieSizeAdjustAdd(size);
745 PartitionBucket* bucket = partitionGenericSizeToBucket(root, size); 745 PartitionBucket* bucket = partitionGenericSizeToBucket(root, size);
746 // TODO(bashi): Remove following RELEAE_ASSERT() once we find the cause of
747 // http://crbug.com/514141
748 #if OS(ANDROID)
749 RELEASE_ASSERT(bucket >= &root->buckets[0] && bucket <= &root->buckets[kGene ricNumBuckets-1]);
haraken 2015/11/06 04:24:09 It would be more helpful to split the assert into
bashi 2015/11/06 04:40:37 Done.
750 #endif
746 spinLockLock(&root->lock); 751 spinLockLock(&root->lock);
747 void* ret = partitionBucketAlloc(root, flags, size, bucket); 752 void* ret = partitionBucketAlloc(root, flags, size, bucket);
748 spinLockUnlock(&root->lock); 753 spinLockUnlock(&root->lock);
749 PartitionAllocHooks::allocationHookIfEnabled(ret, requestedSize); 754 PartitionAllocHooks::allocationHookIfEnabled(ret, requestedSize);
750 return ret; 755 return ret;
751 #endif 756 #endif
752 } 757 }
753 758
754 ALWAYS_INLINE void* partitionAllocGeneric(PartitionRootGeneric* root, size_t siz e) 759 ALWAYS_INLINE void* partitionAllocGeneric(PartitionRootGeneric* root, size_t siz e)
755 { 760 {
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
861 using WTF::partitionAlloc; 866 using WTF::partitionAlloc;
862 using WTF::partitionFree; 867 using WTF::partitionFree;
863 using WTF::partitionAllocGeneric; 868 using WTF::partitionAllocGeneric;
864 using WTF::partitionFreeGeneric; 869 using WTF::partitionFreeGeneric;
865 using WTF::partitionReallocGeneric; 870 using WTF::partitionReallocGeneric;
866 using WTF::partitionAllocActualSize; 871 using WTF::partitionAllocActualSize;
867 using WTF::partitionAllocSupportsGetSize; 872 using WTF::partitionAllocSupportsGetSize;
868 using WTF::partitionAllocGetSize; 873 using WTF::partitionAllocGetSize;
869 874
870 #endif // WTF_PartitionAlloc_h 875 #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