summaryrefslogtreecommitdiff
path: root/src/context/cdinsert_hashmap.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/context/cdinsert_hashmap.h')
-rw-r--r--src/context/cdinsert_hashmap.h39
1 files changed, 21 insertions, 18 deletions
diff --git a/src/context/cdinsert_hashmap.h b/src/context/cdinsert_hashmap.h
index db679c1f7..9211ff7da 100644
--- a/src/context/cdinsert_hashmap.h
+++ b/src/context/cdinsert_hashmap.h
@@ -221,7 +221,8 @@ private:
* restored on a pop). The saved information is allocated using the
* ContextMemoryManager.
*/
- ContextObj* save(ContextMemoryManager* pCMM) {
+ ContextObj* save(ContextMemoryManager* pCMM) override
+ {
ContextObj* data = new(pCMM) CDInsertHashMap<Key, Data, HashFcn>(*this);
Debug("CDInsertHashMap") << "save " << this
<< " at level " << this->getContext()->getLevel()
@@ -237,23 +238,25 @@ protected:
* of new pushFront calls have happened since saving.
* The d_insertMap is untouched and d_pushFronts is also kept.
*/
- void restore(ContextObj* data) {
- Debug("CDInsertHashMap") << "restore " << this
- << " level " << this->getContext()->getLevel()
- << " data == " << data
- << " d_insertMap == " << this->d_insertMap << std::endl;
- size_t oldSize = ((CDInsertHashMap<Key, Data, HashFcn>*)data)->d_size;
- size_t oldPushFronts = ((CDInsertHashMap<Key, Data, HashFcn>*)data)->d_pushFronts;
- Assert(oldPushFronts <= d_pushFronts);
-
- // The size to restore to.
- size_t restoreSize = oldSize + (d_pushFronts - oldPushFronts);
- d_insertMap->pop_to_size(restoreSize);
- d_size = restoreSize;
- Assert(d_insertMap->size() == d_size);
- Debug("CDInsertHashMap") << "restore " << this
- << " level " << this->getContext()->getLevel()
- << " size back to " << this->d_size << std::endl;
+ void restore(ContextObj* data) override
+ {
+ Debug("CDInsertHashMap")
+ << "restore " << this << " level " << this->getContext()->getLevel()
+ << " data == " << data << " d_insertMap == " << this->d_insertMap
+ << std::endl;
+ size_t oldSize = ((CDInsertHashMap<Key, Data, HashFcn>*)data)->d_size;
+ size_t oldPushFronts =
+ ((CDInsertHashMap<Key, Data, HashFcn>*)data)->d_pushFronts;
+ Assert(oldPushFronts <= d_pushFronts);
+
+ // The size to restore to.
+ size_t restoreSize = oldSize + (d_pushFronts - oldPushFronts);
+ d_insertMap->pop_to_size(restoreSize);
+ d_size = restoreSize;
+ Assert(d_insertMap->size() == d_size);
+ Debug("CDInsertHashMap")
+ << "restore " << this << " level " << this->getContext()->getLevel()
+ << " size back to " << this->d_size << std::endl;
}
public:
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback