Browse Source

No need to clean the arrays. We write over everything.

pull/1054/head
James Jackson-South 7 years ago
parent
commit
7ce4327080
  1. 6
      src/ImageSharp/Formats/Png/Zlib/DeflaterEngine.cs

6
src/ImageSharp/Formats/Png/Zlib/DeflaterEngine.cs

@ -155,17 +155,17 @@ namespace SixLabors.ImageSharp.Formats.Png.Zlib
// Create pinned pointers to the various buffers to allow indexing
// without bounds checks.
this.windowBuffer = memoryAllocator.AllocateManagedByteBuffer(2 * DeflaterConstants.WSIZE, AllocationOptions.Clean);
this.windowBuffer = memoryAllocator.AllocateManagedByteBuffer(2 * DeflaterConstants.WSIZE);
this.window = this.windowBuffer.Array;
this.windowBufferHandle = this.windowBuffer.Memory.Pin();
this.pinnedWindowPointer = (byte*)this.windowBufferHandle.Pointer;
this.headBuffer = memoryAllocator.Allocate<short>(DeflaterConstants.HASH_SIZE, AllocationOptions.Clean);
this.headBuffer = memoryAllocator.Allocate<short>(DeflaterConstants.HASH_SIZE);
this.head = this.headBuffer.Memory;
this.headBufferHandle = this.headBuffer.Memory.Pin();
this.pinnedHeadPointer = (short*)this.headBufferHandle.Pointer;
this.prevBuffer = memoryAllocator.Allocate<short>(DeflaterConstants.WSIZE, AllocationOptions.Clean);
this.prevBuffer = memoryAllocator.Allocate<short>(DeflaterConstants.WSIZE);
this.prev = this.prevBuffer.Memory;
this.prevBufferHandle = this.prevBuffer.Memory.Pin();
this.pinnedPrevPointer = (short*)this.prevBufferHandle.Pointer;

Loading…
Cancel
Save