| 338 | } |
| 339 | |
| 340 | int64_t LlvmCodeGenCacheTest::GetMemCharge( |
| 341 | LlvmCodeGen* codegen, const string& key_str, bool is_normal_mode) { |
| 342 | if (is_normal_mode) { |
| 343 | return codegen->engine_cache()->objSize() + key_str.size() |
| 344 | + sizeof(CodeGenCacheEntry); |
| 345 | } |
| 346 | // Optimal mode would use hash code and length as the key. |
| 347 | return codegen->engine_cache()->objSize() + CodeGenCacheKey::OptimalKeySize |
| 348 | + sizeof(CodeGenCacheEntry); |
| 349 | } |
| 350 | |
| 351 | /// Test the situation that the codegen cache hits the limit of capacity, in this case, |
| 352 | /// eviction is needed when new insertion comes. |
nothing calls this directly
no test coverage detected