halcanary@google.com | 2c7c7ee | 2013-12-05 18:31:42 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2013 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #include "SkDiscardableMemoryPool.h" |
Hal Canary | a294be2 | 2017-04-19 13:17:59 -0400 | [diff] [blame] | 9 | #include "SkDiscardableMemory.h" |
| 10 | #include "SkMakeUnique.h" |
Herb Derby | b549cc3 | 2017-03-27 13:35:15 -0400 | [diff] [blame] | 11 | #include "SkMalloc.h" |
mtklein | 1b24933 | 2015-07-07 12:21:21 -0700 | [diff] [blame] | 12 | #include "SkMutex.h" |
commit-bot@chromium.org | cf2f008 | 2014-04-04 16:43:38 +0000 | [diff] [blame] | 13 | #include "SkTInternalLList.h" |
Hal Canary | a294be2 | 2017-04-19 13:17:59 -0400 | [diff] [blame] | 14 | #include "SkTemplates.h" |
halcanary@google.com | 2c7c7ee | 2013-12-05 18:31:42 +0000 | [diff] [blame] | 15 | |
| 16 | // Note: |
| 17 | // A PoolDiscardableMemory is memory that is counted in a pool. |
| 18 | // A DiscardableMemoryPool is a pool of PoolDiscardableMemorys. |
| 19 | |
commit-bot@chromium.org | cf2f008 | 2014-04-04 16:43:38 +0000 | [diff] [blame] | 20 | namespace { |
| 21 | |
| 22 | class PoolDiscardableMemory; |
| 23 | |
halcanary@google.com | 2c7c7ee | 2013-12-05 18:31:42 +0000 | [diff] [blame] | 24 | /** |
commit-bot@chromium.org | cf2f008 | 2014-04-04 16:43:38 +0000 | [diff] [blame] | 25 | * This non-global pool can be used for unit tests to verify that the |
| 26 | * pool works. |
halcanary@google.com | 2c7c7ee | 2013-12-05 18:31:42 +0000 | [diff] [blame] | 27 | */ |
commit-bot@chromium.org | cf2f008 | 2014-04-04 16:43:38 +0000 | [diff] [blame] | 28 | class DiscardableMemoryPool : public SkDiscardableMemoryPool { |
halcanary@google.com | 2c7c7ee | 2013-12-05 18:31:42 +0000 | [diff] [blame] | 29 | public: |
Hal Canary | 788c3c4 | 2017-04-25 08:58:57 -0400 | [diff] [blame] | 30 | DiscardableMemoryPool(size_t budget); |
Brian Salomon | d3b6597 | 2017-03-22 12:05:03 -0400 | [diff] [blame] | 31 | ~DiscardableMemoryPool() override; |
commit-bot@chromium.org | cf2f008 | 2014-04-04 16:43:38 +0000 | [diff] [blame] | 32 | |
Hal Canary | a294be2 | 2017-04-19 13:17:59 -0400 | [diff] [blame] | 33 | std::unique_ptr<SkDiscardableMemory> make(size_t bytes); |
| 34 | SkDiscardableMemory* create(size_t bytes) override { |
| 35 | return this->make(bytes).release(); // TODO: change API |
| 36 | } |
commit-bot@chromium.org | cf2f008 | 2014-04-04 16:43:38 +0000 | [diff] [blame] | 37 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 38 | size_t getRAMUsed() override; |
| 39 | void setRAMBudget(size_t budget) override; |
| 40 | size_t getRAMBudget() override { return fBudget; } |
commit-bot@chromium.org | cf2f008 | 2014-04-04 16:43:38 +0000 | [diff] [blame] | 41 | |
| 42 | /** purges all unlocked DMs */ |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 43 | void dumpPool() override; |
commit-bot@chromium.org | cf2f008 | 2014-04-04 16:43:38 +0000 | [diff] [blame] | 44 | |
| 45 | #if SK_LAZY_CACHE_STATS // Defined in SkDiscardableMemoryPool.h |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 46 | int getCacheHits() override { return fCacheHits; } |
| 47 | int getCacheMisses() override { return fCacheMisses; } |
| 48 | void resetCacheHitsAndMisses() override { |
commit-bot@chromium.org | cf2f008 | 2014-04-04 16:43:38 +0000 | [diff] [blame] | 49 | fCacheHits = fCacheMisses = 0; |
| 50 | } |
| 51 | int fCacheHits; |
| 52 | int fCacheMisses; |
| 53 | #endif // SK_LAZY_CACHE_STATS |
| 54 | |
| 55 | private: |
Hal Canary | 788c3c4 | 2017-04-25 08:58:57 -0400 | [diff] [blame] | 56 | SkMutex fMutex; |
sclittle | d9f5d20 | 2016-05-04 18:23:30 -0700 | [diff] [blame] | 57 | size_t fBudget; |
| 58 | size_t fUsed; |
commit-bot@chromium.org | cf2f008 | 2014-04-04 16:43:38 +0000 | [diff] [blame] | 59 | SkTInternalLList<PoolDiscardableMemory> fList; |
| 60 | |
| 61 | /** Function called to free memory if needed */ |
| 62 | void dumpDownTo(size_t budget); |
| 63 | /** called by DiscardableMemoryPool upon destruction */ |
Hal Canary | a294be2 | 2017-04-19 13:17:59 -0400 | [diff] [blame] | 64 | void removeFromPool(PoolDiscardableMemory* dm); |
commit-bot@chromium.org | cf2f008 | 2014-04-04 16:43:38 +0000 | [diff] [blame] | 65 | /** called by DiscardableMemoryPool::lock() */ |
| 66 | bool lock(PoolDiscardableMemory* dm); |
| 67 | /** called by DiscardableMemoryPool::unlock() */ |
| 68 | void unlock(PoolDiscardableMemory* dm); |
| 69 | |
| 70 | friend class PoolDiscardableMemory; |
| 71 | |
| 72 | typedef SkDiscardableMemory::Factory INHERITED; |
| 73 | }; |
| 74 | |
| 75 | /** |
| 76 | * A PoolDiscardableMemory is a SkDiscardableMemory that relies on |
| 77 | * a DiscardableMemoryPool object to manage the memory. |
| 78 | */ |
| 79 | class PoolDiscardableMemory : public SkDiscardableMemory { |
| 80 | public: |
Hal Canary | a294be2 | 2017-04-19 13:17:59 -0400 | [diff] [blame] | 81 | PoolDiscardableMemory(sk_sp<DiscardableMemoryPool> pool, SkAutoFree pointer, size_t bytes); |
Brian Salomon | d3b6597 | 2017-03-22 12:05:03 -0400 | [diff] [blame] | 82 | ~PoolDiscardableMemory() override; |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 83 | bool lock() override; |
| 84 | void* data() override; |
| 85 | void unlock() override; |
commit-bot@chromium.org | cf2f008 | 2014-04-04 16:43:38 +0000 | [diff] [blame] | 86 | friend class DiscardableMemoryPool; |
halcanary@google.com | 2c7c7ee | 2013-12-05 18:31:42 +0000 | [diff] [blame] | 87 | private: |
commit-bot@chromium.org | cf2f008 | 2014-04-04 16:43:38 +0000 | [diff] [blame] | 88 | SK_DECLARE_INTERNAL_LLIST_INTERFACE(PoolDiscardableMemory); |
Hal Canary | a294be2 | 2017-04-19 13:17:59 -0400 | [diff] [blame] | 89 | sk_sp<DiscardableMemoryPool> fPool; |
commit-bot@chromium.org | cf2f008 | 2014-04-04 16:43:38 +0000 | [diff] [blame] | 90 | bool fLocked; |
Hal Canary | a294be2 | 2017-04-19 13:17:59 -0400 | [diff] [blame] | 91 | SkAutoFree fPointer; |
commit-bot@chromium.org | cf2f008 | 2014-04-04 16:43:38 +0000 | [diff] [blame] | 92 | const size_t fBytes; |
halcanary@google.com | 2c7c7ee | 2013-12-05 18:31:42 +0000 | [diff] [blame] | 93 | }; |
| 94 | |
Hal Canary | a294be2 | 2017-04-19 13:17:59 -0400 | [diff] [blame] | 95 | PoolDiscardableMemory::PoolDiscardableMemory(sk_sp<DiscardableMemoryPool> pool, |
| 96 | SkAutoFree pointer, |
commit-bot@chromium.org | cf2f008 | 2014-04-04 16:43:38 +0000 | [diff] [blame] | 97 | size_t bytes) |
Hal Canary | a294be2 | 2017-04-19 13:17:59 -0400 | [diff] [blame] | 98 | : fPool(std::move(pool)), fLocked(true), fPointer(std::move(pointer)), fBytes(bytes) { |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 99 | SkASSERT(fPool != nullptr); |
| 100 | SkASSERT(fPointer != nullptr); |
halcanary@google.com | 2c7c7ee | 2013-12-05 18:31:42 +0000 | [diff] [blame] | 101 | SkASSERT(fBytes > 0); |
halcanary@google.com | 2c7c7ee | 2013-12-05 18:31:42 +0000 | [diff] [blame] | 102 | } |
| 103 | |
commit-bot@chromium.org | cf2f008 | 2014-04-04 16:43:38 +0000 | [diff] [blame] | 104 | PoolDiscardableMemory::~PoolDiscardableMemory() { |
reed@google.com | 1d0654f | 2013-12-12 22:37:32 +0000 | [diff] [blame] | 105 | SkASSERT(!fLocked); // contract for SkDiscardableMemory |
Hal Canary | a294be2 | 2017-04-19 13:17:59 -0400 | [diff] [blame] | 106 | fPool->removeFromPool(this); |
halcanary@google.com | 2c7c7ee | 2013-12-05 18:31:42 +0000 | [diff] [blame] | 107 | } |
| 108 | |
commit-bot@chromium.org | cf2f008 | 2014-04-04 16:43:38 +0000 | [diff] [blame] | 109 | bool PoolDiscardableMemory::lock() { |
reed@google.com | 1d0654f | 2013-12-12 22:37:32 +0000 | [diff] [blame] | 110 | SkASSERT(!fLocked); // contract for SkDiscardableMemory |
halcanary@google.com | 2c7c7ee | 2013-12-05 18:31:42 +0000 | [diff] [blame] | 111 | return fPool->lock(this); |
| 112 | } |
| 113 | |
commit-bot@chromium.org | cf2f008 | 2014-04-04 16:43:38 +0000 | [diff] [blame] | 114 | void* PoolDiscardableMemory::data() { |
reed@google.com | 1d0654f | 2013-12-12 22:37:32 +0000 | [diff] [blame] | 115 | SkASSERT(fLocked); // contract for SkDiscardableMemory |
Hal Canary | a294be2 | 2017-04-19 13:17:59 -0400 | [diff] [blame] | 116 | return fPointer.get(); |
halcanary@google.com | 2c7c7ee | 2013-12-05 18:31:42 +0000 | [diff] [blame] | 117 | } |
| 118 | |
commit-bot@chromium.org | cf2f008 | 2014-04-04 16:43:38 +0000 | [diff] [blame] | 119 | void PoolDiscardableMemory::unlock() { |
reed@google.com | 1d0654f | 2013-12-12 22:37:32 +0000 | [diff] [blame] | 120 | SkASSERT(fLocked); // contract for SkDiscardableMemory |
halcanary@google.com | 2c7c7ee | 2013-12-05 18:31:42 +0000 | [diff] [blame] | 121 | fPool->unlock(this); |
| 122 | } |
| 123 | |
| 124 | //////////////////////////////////////////////////////////////////////////////// |
| 125 | |
Hal Canary | 788c3c4 | 2017-04-25 08:58:57 -0400 | [diff] [blame] | 126 | DiscardableMemoryPool::DiscardableMemoryPool(size_t budget) |
| 127 | : fBudget(budget) |
halcanary@google.com | 2c7c7ee | 2013-12-05 18:31:42 +0000 | [diff] [blame] | 128 | , fUsed(0) { |
commit-bot@chromium.org | cf2f008 | 2014-04-04 16:43:38 +0000 | [diff] [blame] | 129 | #if SK_LAZY_CACHE_STATS |
halcanary@google.com | 2c7c7ee | 2013-12-05 18:31:42 +0000 | [diff] [blame] | 130 | fCacheHits = 0; |
| 131 | fCacheMisses = 0; |
commit-bot@chromium.org | cf2f008 | 2014-04-04 16:43:38 +0000 | [diff] [blame] | 132 | #endif // SK_LAZY_CACHE_STATS |
halcanary@google.com | 2c7c7ee | 2013-12-05 18:31:42 +0000 | [diff] [blame] | 133 | } |
commit-bot@chromium.org | cf2f008 | 2014-04-04 16:43:38 +0000 | [diff] [blame] | 134 | DiscardableMemoryPool::~DiscardableMemoryPool() { |
| 135 | // PoolDiscardableMemory objects that belong to this pool are |
halcanary@google.com | 2c7c7ee | 2013-12-05 18:31:42 +0000 | [diff] [blame] | 136 | // always deleted before deleting this pool since each one has a |
| 137 | // ref to the pool. |
| 138 | SkASSERT(fList.isEmpty()); |
| 139 | } |
| 140 | |
commit-bot@chromium.org | cf2f008 | 2014-04-04 16:43:38 +0000 | [diff] [blame] | 141 | void DiscardableMemoryPool::dumpDownTo(size_t budget) { |
Hal Canary | 788c3c4 | 2017-04-25 08:58:57 -0400 | [diff] [blame] | 142 | fMutex.assertHeld(); |
halcanary@google.com | 2c7c7ee | 2013-12-05 18:31:42 +0000 | [diff] [blame] | 143 | if (fUsed <= budget) { |
| 144 | return; |
| 145 | } |
Hal Canary | a294be2 | 2017-04-19 13:17:59 -0400 | [diff] [blame] | 146 | using Iter = SkTInternalLList<PoolDiscardableMemory>::Iter; |
halcanary@google.com | 2c7c7ee | 2013-12-05 18:31:42 +0000 | [diff] [blame] | 147 | Iter iter; |
commit-bot@chromium.org | cf2f008 | 2014-04-04 16:43:38 +0000 | [diff] [blame] | 148 | PoolDiscardableMemory* cur = iter.init(fList, Iter::kTail_IterStart); |
bsalomon | 49f085d | 2014-09-05 13:34:00 -0700 | [diff] [blame] | 149 | while ((fUsed > budget) && (cur)) { |
halcanary@google.com | 2c7c7ee | 2013-12-05 18:31:42 +0000 | [diff] [blame] | 150 | if (!cur->fLocked) { |
commit-bot@chromium.org | cf2f008 | 2014-04-04 16:43:38 +0000 | [diff] [blame] | 151 | PoolDiscardableMemory* dm = cur; |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 152 | SkASSERT(dm->fPointer != nullptr); |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 153 | dm->fPointer = nullptr; |
halcanary@google.com | 2c7c7ee | 2013-12-05 18:31:42 +0000 | [diff] [blame] | 154 | SkASSERT(fUsed >= dm->fBytes); |
| 155 | fUsed -= dm->fBytes; |
| 156 | cur = iter.prev(); |
| 157 | // Purged DMs are taken out of the list. This saves times |
| 158 | // looking them up. Purged DMs are NOT deleted. |
| 159 | fList.remove(dm); |
| 160 | } else { |
| 161 | cur = iter.prev(); |
| 162 | } |
| 163 | } |
| 164 | } |
| 165 | |
Hal Canary | a294be2 | 2017-04-19 13:17:59 -0400 | [diff] [blame] | 166 | std::unique_ptr<SkDiscardableMemory> DiscardableMemoryPool::make(size_t bytes) { |
Mike Reed | 8dc8dbc | 2018-01-05 11:20:10 -0500 | [diff] [blame] | 167 | SkAutoFree addr(sk_malloc_canfail(bytes)); |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 168 | if (nullptr == addr) { |
| 169 | return nullptr; |
halcanary@google.com | 2c7c7ee | 2013-12-05 18:31:42 +0000 | [diff] [blame] | 170 | } |
Hal Canary | a294be2 | 2017-04-19 13:17:59 -0400 | [diff] [blame] | 171 | auto dm = skstd::make_unique<PoolDiscardableMemory>(sk_ref_sp(this), std::move(addr), bytes); |
halcanary@google.com | 2c7c7ee | 2013-12-05 18:31:42 +0000 | [diff] [blame] | 172 | SkAutoMutexAcquire autoMutexAcquire(fMutex); |
Hal Canary | a294be2 | 2017-04-19 13:17:59 -0400 | [diff] [blame] | 173 | fList.addToHead(dm.get()); |
halcanary@google.com | 2c7c7ee | 2013-12-05 18:31:42 +0000 | [diff] [blame] | 174 | fUsed += bytes; |
| 175 | this->dumpDownTo(fBudget); |
Hal Canary | a294be2 | 2017-04-19 13:17:59 -0400 | [diff] [blame] | 176 | return std::move(dm); |
halcanary@google.com | 2c7c7ee | 2013-12-05 18:31:42 +0000 | [diff] [blame] | 177 | } |
| 178 | |
Hal Canary | a294be2 | 2017-04-19 13:17:59 -0400 | [diff] [blame] | 179 | void DiscardableMemoryPool::removeFromPool(PoolDiscardableMemory* dm) { |
halcanary | 2edf599 | 2015-03-26 14:08:56 -0700 | [diff] [blame] | 180 | SkAutoMutexAcquire autoMutexAcquire(fMutex); |
halcanary@google.com | 2c7c7ee | 2013-12-05 18:31:42 +0000 | [diff] [blame] | 181 | // This is called by dm's destructor. |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 182 | if (dm->fPointer != nullptr) { |
halcanary@google.com | 2c7c7ee | 2013-12-05 18:31:42 +0000 | [diff] [blame] | 183 | SkASSERT(fUsed >= dm->fBytes); |
| 184 | fUsed -= dm->fBytes; |
| 185 | fList.remove(dm); |
| 186 | } else { |
| 187 | SkASSERT(!fList.isInList(dm)); |
| 188 | } |
| 189 | } |
| 190 | |
commit-bot@chromium.org | cf2f008 | 2014-04-04 16:43:38 +0000 | [diff] [blame] | 191 | bool DiscardableMemoryPool::lock(PoolDiscardableMemory* dm) { |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 192 | SkASSERT(dm != nullptr); |
halcanary@google.com | 2c7c7ee | 2013-12-05 18:31:42 +0000 | [diff] [blame] | 193 | SkAutoMutexAcquire autoMutexAcquire(fMutex); |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 194 | if (nullptr == dm->fPointer) { |
halcanary@google.com | 2c7c7ee | 2013-12-05 18:31:42 +0000 | [diff] [blame] | 195 | // May have been purged while waiting for lock. |
commit-bot@chromium.org | cf2f008 | 2014-04-04 16:43:38 +0000 | [diff] [blame] | 196 | #if SK_LAZY_CACHE_STATS |
halcanary@google.com | 2c7c7ee | 2013-12-05 18:31:42 +0000 | [diff] [blame] | 197 | ++fCacheMisses; |
commit-bot@chromium.org | cf2f008 | 2014-04-04 16:43:38 +0000 | [diff] [blame] | 198 | #endif // SK_LAZY_CACHE_STATS |
halcanary@google.com | 2c7c7ee | 2013-12-05 18:31:42 +0000 | [diff] [blame] | 199 | return false; |
| 200 | } |
| 201 | dm->fLocked = true; |
| 202 | fList.remove(dm); |
| 203 | fList.addToHead(dm); |
commit-bot@chromium.org | cf2f008 | 2014-04-04 16:43:38 +0000 | [diff] [blame] | 204 | #if SK_LAZY_CACHE_STATS |
halcanary@google.com | 2c7c7ee | 2013-12-05 18:31:42 +0000 | [diff] [blame] | 205 | ++fCacheHits; |
commit-bot@chromium.org | cf2f008 | 2014-04-04 16:43:38 +0000 | [diff] [blame] | 206 | #endif // SK_LAZY_CACHE_STATS |
halcanary@google.com | 2c7c7ee | 2013-12-05 18:31:42 +0000 | [diff] [blame] | 207 | return true; |
| 208 | } |
| 209 | |
commit-bot@chromium.org | cf2f008 | 2014-04-04 16:43:38 +0000 | [diff] [blame] | 210 | void DiscardableMemoryPool::unlock(PoolDiscardableMemory* dm) { |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 211 | SkASSERT(dm != nullptr); |
halcanary@google.com | 2c7c7ee | 2013-12-05 18:31:42 +0000 | [diff] [blame] | 212 | SkAutoMutexAcquire autoMutexAcquire(fMutex); |
| 213 | dm->fLocked = false; |
| 214 | this->dumpDownTo(fBudget); |
| 215 | } |
| 216 | |
commit-bot@chromium.org | cf2f008 | 2014-04-04 16:43:38 +0000 | [diff] [blame] | 217 | size_t DiscardableMemoryPool::getRAMUsed() { |
halcanary@google.com | 2c7c7ee | 2013-12-05 18:31:42 +0000 | [diff] [blame] | 218 | return fUsed; |
| 219 | } |
commit-bot@chromium.org | cf2f008 | 2014-04-04 16:43:38 +0000 | [diff] [blame] | 220 | void DiscardableMemoryPool::setRAMBudget(size_t budget) { |
halcanary@google.com | 2c7c7ee | 2013-12-05 18:31:42 +0000 | [diff] [blame] | 221 | SkAutoMutexAcquire autoMutexAcquire(fMutex); |
| 222 | fBudget = budget; |
| 223 | this->dumpDownTo(fBudget); |
| 224 | } |
commit-bot@chromium.org | cf2f008 | 2014-04-04 16:43:38 +0000 | [diff] [blame] | 225 | void DiscardableMemoryPool::dumpPool() { |
halcanary@google.com | 2c7c7ee | 2013-12-05 18:31:42 +0000 | [diff] [blame] | 226 | SkAutoMutexAcquire autoMutexAcquire(fMutex); |
| 227 | this->dumpDownTo(0); |
| 228 | } |
| 229 | |
commit-bot@chromium.org | cf2f008 | 2014-04-04 16:43:38 +0000 | [diff] [blame] | 230 | } // namespace |
| 231 | |
Hal Canary | 788c3c4 | 2017-04-25 08:58:57 -0400 | [diff] [blame] | 232 | sk_sp<SkDiscardableMemoryPool> SkDiscardableMemoryPool::Make(size_t size) { |
| 233 | return sk_make_sp<DiscardableMemoryPool>(size); |
commit-bot@chromium.org | cf2f008 | 2014-04-04 16:43:38 +0000 | [diff] [blame] | 234 | } |
| 235 | |
halcanary@google.com | 2c7c7ee | 2013-12-05 18:31:42 +0000 | [diff] [blame] | 236 | SkDiscardableMemoryPool* SkGetGlobalDiscardableMemoryPool() { |
Hal Canary | a294be2 | 2017-04-19 13:17:59 -0400 | [diff] [blame] | 237 | // Intentionally leak this global pool. |
| 238 | static SkDiscardableMemoryPool* global = |
Hal Canary | 788c3c4 | 2017-04-25 08:58:57 -0400 | [diff] [blame] | 239 | new DiscardableMemoryPool(SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE); |
mtklein | ffa4a92 | 2016-05-05 16:05:56 -0700 | [diff] [blame] | 240 | return global; |
halcanary@google.com | 2c7c7ee | 2013-12-05 18:31:42 +0000 | [diff] [blame] | 241 | } |