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

Unified Diff: Source/platform/heap/Heap.h

Issue 964363002: Oilpan: define shrink{Inline}VectorBackingInternal inline. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: explanatory comment Created 5 years, 10 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/platform/heap/Heap.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/Heap.h
diff --git a/Source/platform/heap/Heap.h b/Source/platform/heap/Heap.h
index 182541a95d5fb96dfbb3fed7ce22225809d0340a..f05faf7a21f73adbb4d684f0939d5183802b6dc0 100644
--- a/Source/platform/heap/Heap.h
+++ b/Source/platform/heap/Heap.h
@@ -1573,7 +1573,13 @@ public:
}
PLATFORM_EXPORT static void freeVectorBacking(void*);
PLATFORM_EXPORT static bool expandVectorBacking(void*, size_t);
- PLATFORM_EXPORT static bool shrinkVectorBacking(void*, size_t quantizedCurrentSize, size_t quantizedShrunkSize);
+ static inline bool shrinkVectorBacking(void* address, size_t quantizedCurrentSize, size_t quantizedShrunkSize)
+ {
+ // Returns always true, so the inlining in turn enables call site simplifications.
+ backingShrink(address, quantizedCurrentSize, quantizedShrunkSize);
+ return true;
+ }
+
template <typename T>
static T* allocateInlineVectorBacking(size_t size)
{
@@ -1582,7 +1588,11 @@ public:
}
PLATFORM_EXPORT static void freeInlineVectorBacking(void*);
PLATFORM_EXPORT static bool expandInlineVectorBacking(void*, size_t);
- PLATFORM_EXPORT static bool shrinkInlineVectorBacking(void*, size_t quantizedCurrentSize, size_t quantizedShrinkedSize);
+ static inline bool shrinkInlineVectorBacking(void* address, size_t quantizedCurrentSize, size_t quantizedShrunkSize)
+ {
+ backingShrink(address, quantizedCurrentSize, quantizedShrunkSize);
+ return true;
+ }
template <typename T, typename HashTable>
static T* allocateHashTableBacking(size_t size)
@@ -1688,7 +1698,7 @@ public:
private:
static void backingFree(void*);
static bool backingExpand(void*, size_t);
- static void backingShrink(void*, size_t quantizedCurrentSize, size_t quantizedShrunkSize);
+ PLATFORM_EXPORT static void backingShrink(void*, size_t quantizedCurrentSize, size_t quantizedShrunkSize);
template<typename T, size_t u, typename V> friend class WTF::Vector;
template<typename T, typename U, typename V, typename W> friend class WTF::HashSet;
« no previous file with comments | « no previous file | Source/platform/heap/Heap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698