public UnmanagedBlob(StandardRuntimePlatform plat, int size) { _plat = plat; Address = plat.Alloc(size); GC.AddMemoryPressure(size); Size = size; #if DEBUG _backtrace = Environment.StackTrace; Backtraces.Add(_backtrace); #endif }
public UnmanagedBlob(StandardRuntimePlatform plat, int size) { if (size <= 0) { throw new ArgumentException("Positive number required", nameof(size)); } _plat = plat; _address = plat.Alloc(size); GC.AddMemoryPressure(size); Size = size; #if DEBUG _backtrace = Environment.StackTrace; lock (_btlock) Backtraces.Add(_backtrace); #endif }