GitLab will be upgraded to the 12.10.14-ce.0 on 28 Sept 2020 at 2.00pm (AEDT) to 2.30pm (AEDT). During the update, GitLab and Mattermost services will not be available. If you have any concerns with this, please talk to us at N110 (b) CSIT building.

Commit 07c4183f authored by Isaac Oscar Gariano's avatar Isaac Oscar Gariano

Dumped unneeded VM fiels as empty hashmaps instead of null bytes

parent e9d49a43
......@@ -62,9 +62,6 @@ pub struct VM { // The comments are the offset into the struct
pub primordial: RwLock<Option<MuPrimordialThread>>, // +568
pub vm_options: VMOptions, // +624
// WARNING: It will segfault if you try to acquire a lock, after loading a dump,
// from one of the fields that aren't dumped
// ---partially serialize---
compiled_funcs: RwLock<HashMap<MuID, RwLock<CompiledFunction>>>, // +728
......@@ -104,9 +101,19 @@ unsafe impl rodal::Dump for VM {
dumper.dump_object(&self.compiled_funcs);
dumper.dump_object(&self.exception_table);
// Dump an emepty hashmap for the compiled_exception_table
// Dump empty maps so that we can safely read and modify them once loaded
dumper.dump_padding(&self.global_locations);
dumper.dump_object_here(&RwLock::new(rodal::EmptyHashMap::<MuID, ValueLocation>::new()));
dumper.dump_padding(&self.func_vers);
dumper.dump_object_here(&RwLock::new(rodal::EmptyHashMap::<MuID, RwLock<MuFunctionVersion>>::new()));
dumper.dump_padding(&self.aot_pending_funcref_store);
dumper.dump_object_here(&RwLock::new(rodal::EmptyHashMap::<Address, ValueLocation>::new()));
// Dump an emepty hashmap for the other hashmaps
dumper.dump_padding(&self.compiled_exception_table);
dumper.dump_object_here(&RwLock::new(HashMap::<Address, (Address, *const CompiledFunction)>::new()));
dumper.dump_object_here(&RwLock::new(rodal::EmptyHashMap::<Address, (Address, *const CompiledFunction)>::new()));
// This field is actually stored at the end of the struct, the others all have the same allignment so are not reordered
dumper.dump_object(&self.is_running);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment