Browse Source

Address feedback

pull/3120/head
James Jackson-South 2 months ago
parent
commit
88acf75b11
  1. 8
      src/ImageSharp/Memory/Allocators/MemoryAllocator.cs
  2. 5
      src/ImageSharp/Memory/Allocators/MemoryAllocatorOptions.cs

8
src/ImageSharp/Memory/Allocators/MemoryAllocator.cs

@ -35,12 +35,12 @@ public abstract class MemoryAllocator
internal long MemoryGroupAllocationLimitBytes { get; private protected set; } = Environment.Is64BitProcess ? 4L * OneGigabyte : OneGigabyte;
/// <summary>
/// Gets the maximum allowed total allocation size, in bytes, for the current process.
/// Gets the maximum cumulative size, in bytes, of all active allocations made through this allocator instance.
/// </summary>
/// <remarks>
/// Defaults to <see cref="long.MaxValue"/>, effectively imposing no limit on total allocations.
/// This property can be set to enforce a cap on total memory usage across all allocations made through this allocator instance, providing
/// a safeguard against excessive memory consumption.<br/>
/// Defaults to <see cref="long.MaxValue"/>, effectively imposing no limit on the cumulative total.
/// When set, this provides a safeguard against excessive memory consumption by capping the combined size of
/// outstanding allocations issued by this instance.<br/>
/// When the cumulative size of active allocations exceeds this limit, an <see cref="InvalidMemoryOperationException"/> will be thrown to
/// prevent further allocations and signal that the limit has been breached.
/// </remarks>

5
src/ImageSharp/Memory/Allocators/MemoryAllocatorOptions.cs

@ -49,8 +49,9 @@ public struct MemoryAllocatorOptions
}
/// <summary>
/// Gets or sets a value defining the maximum total size that can be allocated by the allocator in Megabytes.
/// <see langword="null"/> means platform default: 2GB on 32-bit processes, 8GB on 64-bit processes.
/// Gets or sets a value defining the maximum cumulative size, in Megabytes, of all active allocations made
/// through the created <see cref="MemoryAllocator"/> instance.
/// <see langword="null"/> (the default) imposes no limit on the cumulative total.
/// </summary>
public int? AccumulativeAllocationLimitMegabytes
{

Loading…
Cancel
Save