diff --git a/src/Hastlayer/Hast.Communication/Services/DevicePoolManager.cs b/src/Hastlayer/Hast.Communication/Services/DevicePoolManager.cs index e481e0b4..bf3c53d1 100644 --- a/src/Hastlayer/Hast.Communication/Services/DevicePoolManager.cs +++ b/src/Hastlayer/Hast.Communication/Services/DevicePoolManager.cs @@ -94,7 +94,7 @@ void Disposer(ReservedDevice thisReservedDevice) var reservationCompletionSource = new TaskCompletionSource(); - _waitQueue.Enqueue(freedUpDevice => reservationCompletionSource.SetResult(freedUpDevice)); + _waitQueue.Enqueue(reservationCompletionSource.SetResult); return reservationCompletionSource.Task; } diff --git a/src/Hastlayer/Hast.Transformer/SimpleMemory/SimpleMemory.cs b/src/Hastlayer/Hast.Transformer/SimpleMemory/SimpleMemory.cs index c5bdfd9a..34164953 100644 --- a/src/Hastlayer/Hast.Transformer/SimpleMemory/SimpleMemory.cs +++ b/src/Hastlayer/Hast.Transformer/SimpleMemory/SimpleMemory.cs @@ -79,7 +79,7 @@ public class SimpleMemory /// The alignment value. If set to greater than 0, the starting address of the content is aligned to be a multiple /// of that number. It must be an integer and power of 2. /// - internal SimpleMemory(Memory memory, int prefixCellCount, int alignment) + internal SimpleMemory(Memory memory, int prefixCellCount, int alignment, bool isDebug) { if (alignment > 0) { @@ -102,7 +102,7 @@ internal SimpleMemory(Memory memory, int prefixCellCount, int alignment) { memory = memory.Slice(alignmentOffset, memory.Length - alignment); } - else if (IsDebug) + else if (isDebug) { // This should never happen in production. Console.Error.WriteLine("Alignment failed!"); @@ -174,7 +174,7 @@ public static SimpleMemory Create(IMemoryConfiguration memoryConfiguration, int { var memory = new byte[((cellCount + memoryConfiguration.MinimumPrefix) * MemoryCellSizeBytes) + memoryConfiguration.Alignment]; - return new SimpleMemory(memory, memoryConfiguration.MinimumPrefix, memoryConfiguration.Alignment); + return new SimpleMemory(memory, memoryConfiguration.MinimumPrefix, memoryConfiguration.Alignment, IsDebug); } /// @@ -209,7 +209,7 @@ public static SimpleMemory Create(IMemoryConfiguration memoryConfiguration, int withPrefixCells = memoryConfiguration.MinimumPrefix; } - return new SimpleMemory(memory, withPrefixCells, 0); + return new SimpleMemory(memory, withPrefixCells, 0, IsDebug); } /// @@ -219,7 +219,7 @@ public static SimpleMemory Create(IMemoryConfiguration memoryConfiguration, int /// The size of the usable memory. /// The instance with a byte[] of capacity for the require payload size. public static SimpleMemory CreateSoftwareMemory(int cellCount) => - new(new byte[cellCount * MemoryCellSizeBytes], 0, 0); + new(new byte[cellCount * MemoryCellSizeBytes], 0, 0, IsDebug); } ///