| 291 | } |
| 292 | |
| 293 | void DsqlStatementCache::shrink() |
| 294 | { |
| 295 | #ifdef DSQL_STATEMENT_CACHE_DEBUG |
| 296 | printf("DsqlStatementCache::shrink() - cacheSize: %u, maxCacheSize: %u\n\n", cacheSize, maxCacheSize); |
| 297 | #endif |
| 298 | |
| 299 | while (cacheSize > maxCacheSize && !inactiveStatementList.isEmpty()) |
| 300 | { |
| 301 | const auto& front = inactiveStatementList.front(); |
| 302 | front.dsqlStatement->resetCacheKey(); |
| 303 | map.remove(front.key); |
| 304 | cacheSize -= front.size; |
| 305 | inactiveStatementList.erase(inactiveStatementList.begin()); |
| 306 | } |
| 307 | |
| 308 | #ifdef DSQL_STATEMENT_CACHE_DEBUG |
| 309 | dump(); |
| 310 | #endif |
| 311 | } |
| 312 | |
| 313 | void DsqlStatementCache::ensureLockIsCreated(thread_db* tdbb) |
| 314 | { |
no test coverage detected