public IntPtr Localloc(uint guardPos, uint size) { var node = new LocallocNode { GuardPos = guardPos, Memory = Marshal.AllocHGlobal((int)size) }; var insert = localPool; while (insert != null) { if (insert.Next == null || insert.Next.GuardPos < guardPos) { break; } insert = insert.Next; } if (insert == null) { localPool = node; } else { node.Next = insert.Next; insert.Next = node; } return(node.Memory); }
private void CheckFreeLocalloc() { while (localPool != null && localPool.GuardPos > topPos) { localPool = localPool.Free(); } }
private void CheckFreeLocalloc() { while (this.localPool != null && this.localPool.GuardPos > this.topPos) { this.localPool = this.localPool.Free(); } }
public void FreeAllLocalloc() { var node = localPool; while(node != null) node = node.Free(); localPool = null; }
public void FreeAllLocalloc() { LocallocNode node = this.localPool; while (node != null) { node = node.Free(); } this.localPool = null; }