File tree Expand file tree Collapse file tree
src/ImageSharp/Memory/Allocators Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,10 +38,13 @@ public abstract class MemoryAllocator
3838 /// Gets the maximum allowed total allocation size, in bytes, for the current process.
3939 /// </summary>
4040 /// <remarks>
41- /// The allocation limit is determined based on the process architecture. For 64-bit processes,
42- /// the limit is higher than for 32-bit processes.
41+ /// Defaults to <see cref="long.MaxValue"/>, effectively imposing no limit on total allocations.
42+ /// This property can be set to enforce a cap on total memory usage across all allocations made through this allocator instance, providing
43+ /// a safeguard against excessive memory consumption.<br/>
44+ /// When the cumulative size of active allocations exceeds this limit, an <see cref="InvalidMemoryOperationException"/> will be thrown to
45+ /// prevent further allocations and signal that the limit has been breached.
4346 /// </remarks>
44- internal long AccumulativeAllocationLimitBytes { get ; private protected set ; } = Environment . Is64BitProcess ? 8L * OneGigabyte : 2L * OneGigabyte ;
47+ internal long AccumulativeAllocationLimitBytes { get ; private protected set ; } = long . MaxValue ;
4548
4649 /// <summary>
4750 /// Gets the maximum size, in bytes, that can be allocated for a single buffer.
You can’t perform that action at this time.
0 commit comments