This is a performance tool to prevent us copying over an object we're going to overwrite anyways
| 2693 | |
| 2694 | // This is a performance tool to prevent us copying over an object we're going to overwrite anyways |
| 2695 | void redisDbPersistentData::prepOverwriteForSnapshot(char *key) |
| 2696 | { |
| 2697 | if (g_pserver->maxmemory_policy & MAXMEMORY_FLAG_LFU) |
| 2698 | return; |
| 2699 | |
| 2700 | if (m_pdbSnapshot != nullptr) |
| 2701 | { |
| 2702 | auto itr = m_pdbSnapshot->find_cached_threadsafe(key); |
| 2703 | if (itr.key() != nullptr) |
| 2704 | { |
| 2705 | sds keyNew = sdsdupshared(itr.key()); |
| 2706 | if (dictAdd(m_pdictTombstone, keyNew, (void*)dictHashKey(m_pdict, key)) != DICT_OK) |
| 2707 | sdsfree(keyNew); |
| 2708 | } |
| 2709 | } |
| 2710 | } |
| 2711 | |
| 2712 | void redisDbPersistentData::tryResize() |
| 2713 | { |
no test coverage detected