Пример #1
0
 public GenPartitionRequire(IntPtr txnPtr, IntPtr waitHandle, IntPtr pkPtr)
 {
     TxnPtr     = txnPtr;
     WaitHandle = waitHandle;
     unsafe
     {
         PartitionInfo *src = (PartitionInfo *)pkPtr.ToPointer();
         PartitionInfo = *src;
     }
 }
Пример #2
0
        public unsafe void ReadObject(BinSerializer bs)
        {
            TxnPtr     = new IntPtr(bs.ReadInt64());
            WaitHandle = new IntPtr(bs.ReadInt64());
            var info = new PartitionInfo();

            info.Flags = bs.ReadByte();
            int size = bs.ReadInt32();

            info.KeySize = new IntPtr(size);
            info.KeyPtr  = Marshal.AllocHGlobal(size);
            var span = new Span <byte>(info.KeyPtr.ToPointer(), size);

            bs.Stream.Read(span);
            PartitionInfo = info;
        }