/// <summary> /// Get pooled memory chunk. /// </summary> /// <param name="memPtr">Memory pointer.</param> /// <returns>Memory chunk.</returns> public PlatformMemory Get(long memPtr) { long delta = memPtr - handle.ToInt64(); if (delta == PlatformMemoryUtils.PoolHdrOffMem1) return _mem1 ?? (_mem1 = new PlatformPooledMemory(this, memPtr)); if (delta == PlatformMemoryUtils.PoolHdrOffMem2) return _mem2 ?? (_mem2 = new PlatformPooledMemory(this, memPtr)); return _mem3 ?? (_mem3 = new PlatformPooledMemory(this, memPtr)); }
/// <summary> /// Get pooled memory chunk. /// </summary> /// <param name="memPtr">Memory pointer.</param> /// <returns>Memory chunk.</returns> public PlatformMemory Get(long memPtr) { long delta = memPtr - handle.ToInt64(); if (delta == PlatformMemoryUtils.PoolHdrOffMem1) { return(_mem1 ?? (_mem1 = new PlatformPooledMemory(memPtr))); } if (delta == PlatformMemoryUtils.PoolHdrOffMem2) { return(_mem2 ?? (_mem2 = new PlatformPooledMemory(memPtr))); } return(_mem3 ?? (_mem3 = new PlatformPooledMemory(memPtr))); }