File tree Expand file tree Collapse file tree 3 files changed +20
-4
lines changed
src/ImageSharp/Memory/Allocators
tests/ImageSharp.Tests/Memory/Allocators Expand file tree Collapse file tree 3 files changed +20
-4
lines changed Original file line number Diff line number Diff line change 22
22
sdk-preview : true
23
23
runtime : -x64
24
24
codecov : false
25
- - os : macos-latest
25
+ - os : macos-13 # macos- latest runs on arm64 runners
26
26
framework : net6.0
27
27
sdk : 6.0.x
28
28
sdk-preview : true
38
38
framework : net5.0
39
39
runtime : -x64
40
40
codecov : false
41
- - os : macos-latest
41
+ - os : macos-13 # macos- latest runs on arm64 runners
42
42
framework : net5.0
43
43
runtime : -x64
44
44
codecov : false
50
50
framework : netcoreapp3.1
51
51
runtime : -x64
52
52
codecov : false
53
- - os : macos-latest
53
+ - os : macos-13 # macos- latest runs on arm64 runners
54
54
framework : netcoreapp3.1
55
55
runtime : -x64
56
56
codecov : false
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ public static MemoryAllocator Create(MemoryAllocatorOptions options)
51
51
UniformUnmanagedMemoryPoolMemoryAllocator allocator = new ( options . MaximumPoolSizeMegabytes ) ;
52
52
if ( options . AllocationLimitMegabytes . HasValue )
53
53
{
54
- allocator . MemoryGroupAllocationLimitBytes = options . AllocationLimitMegabytes . Value * 1024 * 1024 ;
54
+ allocator . MemoryGroupAllocationLimitBytes = options . AllocationLimitMegabytes . Value * 1024L * 1024L ;
55
55
allocator . SingleBufferAllocationLimitBytes = ( int ) Math . Min ( allocator . SingleBufferAllocationLimitBytes , allocator . MemoryGroupAllocationLimitBytes ) ;
56
56
}
57
57
Original file line number Diff line number Diff line change @@ -436,5 +436,21 @@ static void RunTest()
436
436
}
437
437
}
438
438
#endif
439
+
440
+ [ ConditionalFact ( typeof ( Environment ) , nameof ( Environment . Is64BitProcess ) ) ]
441
+ public void MemoryAllocator_Create_SetHighLimit ( )
442
+ {
443
+ RemoteExecutor . Invoke ( RunTest ) . Dispose ( ) ;
444
+ static void RunTest ( )
445
+ {
446
+ const long threeGB = 3L * ( 1 << 30 ) ;
447
+ MemoryAllocator allocator = MemoryAllocator . Create ( new MemoryAllocatorOptions ( )
448
+ {
449
+ AllocationLimitMegabytes = ( int ) ( threeGB / 1024 )
450
+ } ) ;
451
+ using MemoryGroup < byte > memoryGroup = allocator . AllocateGroup < byte > ( threeGB , 1024 ) ;
452
+ Assert . Equal ( threeGB , memoryGroup . TotalLength ) ;
453
+ }
454
+ }
439
455
}
440
456
}
You can’t perform that action at this time.
0 commit comments