int SerializeEnvironment(VmEnvironment env, object obj) { var composite = new Composite { Kind = ObjectTypes.Environment, Elements = new int[2] }; var result = SerializeOneHashed(composite, obj); composite.Elements [0] = Serialize(env.Frame); composite.Elements [1] = Serialize(env.Next); return(result); }
VmEnvironment RebuildEnvironment( object[] objects, int index, Composite composite, Func <int, object> reader) { var result = new VmEnvironment(); objects [index] = result; result.Frame = (VmEnvFrame)reader(composite.Elements [0]); result.Next = (VmEnvironment)reader(composite.Elements [1]); return(result); }