++i) {
// mark it as being a destruction (short-circuit restore())
(*i).second->d_map = NULL;
- (*i).second->deleteSelf();
+ if(!(*i).second->d_noTrash) {
+ (*i).second->deleteSelf();
+ }
}
d_map.clear();
d_first = NULL;
++i) {
// mark it as being a destruction (short-circuit restore())
(*i).second->d_map = NULL;
- (*i).second->deleteSelf();
+ if(!(*i).second->d_noTrash) {
+ (*i).second->deleteSelf();
+ }
}
d_map.clear();
d_first = NULL;
d_map.erase(j);//FIXME multithreading
Debug("gc") << "key " << k << " obliterated zero-scope: " << elt << std::endl;
// was already destructed, so don't call ->deleteSelf()
- ::operator delete(elt);
+ if(!elt->d_noTrash) {
+ ::operator delete(elt);
+ }
}
}
}
};
void testMapOfLists() {
- try{
- //Debug.on("gc");
- //Debug.on("context");
+ //Debug.on("gc");
+ //Debug.on("context");
CDMap<int, CDList<myint>*, int_hasher> map(d_context);
}
TS_ASSERT(d_context->getLevel() == 0);
- } catch(Exception& e) { cout << e << std::endl; throw e; }
+ }
+
+ void testCmmElementsAtLevel0() {
+ // this was crashing
+
+ CDMap<int, int*, int_hasher> map(d_context);
+ int* a = (int*)d_context->getCMM()->newData(sizeof(int));
+ map.insertDataFromContextMemory(1, a);
}
};