public MemoryHolder GetSubBlock(int offset) { // No GC.KeepAlive here because the new MemoryHolder holds onto the previous one. return new MemoryHolder(_data.Add(offset), _size - offset, this); }
object INativeType.GetValue(MemoryHolder /*!*/ owner, object readingFrom, int offset, bool raw) { _Structure res = (_Structure)CreateInstance(this.Context.SharedContext); res._memHolder = owner.GetSubBlock(offset); return(res); }