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; internal long MemoryGroupAllocationLimitBytes { get; private protected set; } = Environment.Is64BitProcess ? 4L * OneGigabyte : OneGigabyte;
/// <summary> /// <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> /// </summary>
/// <remarks> /// <remarks>
/// Defaults to <see cref="long.MaxValue"/>, effectively imposing no limit on total allocations. /// Defaults to <see cref="long.MaxValue"/>, effectively imposing no limit on the cumulative total.
/// This property can be set to enforce a cap on total memory usage across all allocations made through this allocator instance, providing /// When set, this provides a safeguard against excessive memory consumption by capping the combined size of
/// a safeguard against excessive memory consumption.<br/> /// 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 /// 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. /// prevent further allocations and signal that the limit has been breached.
/// </remarks> /// </remarks>

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

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

Loading…
Cancel
Save