39a40
> #include <memory>
199c200
< FuncPageTable::serialize(std::ostream &os)
---
> FuncPageTable::serialize(CheckpointOut &cp) const
201c202
< paramOut(os, "ptable.size", pTable.size());
---
> paramOut(cp, "ptable.size", pTable.size());
203a205,206
> for (auto &pte : pTable) {
> ScopedCheckpointSection sec(cp, csprintf("Entry%d", count++));
205,214c208,209
< PTableItr iter = pTable.begin();
< PTableItr end = pTable.end();
< while (iter != end) {
< os << "\n[" << csprintf("%s.Entry%d", name(), count) << "]\n";
<
< paramOut(os, "vaddr", iter->first);
< iter->second.serialize(os);
<
< ++iter;
< ++count;
---
> paramOut(cp, "vaddr", pte.first);
> pte.second.serialize(cp);
220c215
< FuncPageTable::unserialize(Checkpoint *cp, const std::string &section)
---
> FuncPageTable::unserialize(CheckpointIn &cp)
222,223c217,218
< int i = 0, count;
< paramIn(cp, section, "ptable.size", count);
---
> int count;
> paramIn(cp, "ptable.size", count);
225c220,221
< pTable.clear();
---
> for (int i = 0; i < count; ++i) {
> ScopedCheckpointSection sec(cp, csprintf("Entry%d", i));
227,228c223
< while (i < count) {
< TheISA::TlbEntry *entry;
---
> std::unique_ptr<TheISA::TlbEntry> entry;
231,233c226,229
< paramIn(cp, csprintf("%s.Entry%d", name(), i), "vaddr", vaddr);
< entry = new TheISA::TlbEntry();
< entry->unserialize(cp, csprintf("%s.Entry%d", name(), i));
---
> paramIn(cp, "vaddr", vaddr);
> entry.reset(new TheISA::TlbEntry());
> entry->unserialize(cp);
>
235,236d230
< delete entry;
< ++i;