I have a feeling that I am going to ask a "stupid" question, yet I must ask ...
I have 2 virtual machines.
I would like to copy an instance of an object from one to another,
Is it possible to copy the bits that represents this object in the VM's heap, send it to the other VM, like that the other VM just need to allocate the bits in it's memory and add a reference in it's stack to this memory slot...?
Currently, in order to do such a thing we serialize the object and unserialize it, which is much less efficient(computational wise) than just copy the instance as is...the parsing is a computational waste...
JS serialization Example: each VM is an instance of V8 (JavaScript),
one way of doing it is to convert the object to JSON(JSON.stringify
), send it some how to the other VM which get the string and convert it back to object ( e.g. var myObject = eval('(' + myJSONtext + ')');
) .. (JavaScript is just an example here, this is some sort of serialization)