public MallocTests() : base() { init_privateMemorySize = CurrentProcess.PrivateMemorySize64; init_peakPagedMem = CurrentProcess.PeakPagedMemorySize64; init_peakWorkingSet = CurrentProcess.PeakWorkingSet64; init_peakVirtualMem = CurrentProcess.PeakVirtualMemorySize64; init_allocated = Jem.GetMallCtlUInt64("stats.allocated"); }
public void CanMallocandFree() { long size = 100 * 1000 * 1000; Assert.True(init_privateMemorySize < size); Assert.True(init_allocated < (ulong)size); IntPtr p = Jem.Malloc((ulong)size); string stats = Jem.MallocStatsPrint(); ulong allocated = Jem.GetMallCtlUInt64("stats.allocated"); CurrentProcess.Refresh(); Assert.True((CurrentProcess.PrivateMemorySize64 - init_privateMemorySize) >= size); Assert.True(allocated > (ulong)size); Jem.Free(p); }