| 182 | } |
| 183 | |
| 184 | void DsqlStatementCache::statementGoingInactive(Firebird::RefStrPtr& key) |
| 185 | { |
| 186 | const auto entryPtr = map.get(key); |
| 187 | |
| 188 | if (!entryPtr) |
| 189 | return; |
| 190 | |
| 191 | const auto entry = *entryPtr; |
| 192 | |
| 193 | fb_assert(entry->active); |
| 194 | entry->active = false; |
| 195 | entry->dsqlStatement->addRef(); |
| 196 | entry->size = entry->dsqlStatement->getSize(); // update size |
| 197 | |
| 198 | inactiveStatementList.splice(inactiveStatementList.end(), activeStatementList, entry); |
| 199 | |
| 200 | cacheSize += entry->size; |
| 201 | |
| 202 | if (cacheSize > maxCacheSize) |
| 203 | shrink(); |
| 204 | } |
| 205 | |
| 206 | void DsqlStatementCache::purge(thread_db* tdbb, bool releaseLock) |
| 207 | { |