mirror of
https://github.com/soukoku/ntwain.git
synced 2025-12-01 10:54:08 +08:00
Updated default memory manager for other platform.
This commit is contained in:
35
NTwain/Internals/LinuxMemoryManager.cs
Normal file
35
NTwain/Internals/LinuxMemoryManager.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace NTwain.Internals
|
||||
{
|
||||
class LinuxMemoryManager : IMemoryManager
|
||||
{
|
||||
#region IMemoryManager Members
|
||||
|
||||
public IntPtr Allocate(uint size)
|
||||
{
|
||||
return Marshal.AllocHGlobal((int)size);
|
||||
}
|
||||
|
||||
public void Free(IntPtr handle)
|
||||
{
|
||||
Marshal.FreeHGlobal(handle);
|
||||
}
|
||||
|
||||
public IntPtr Lock(IntPtr handle)
|
||||
{
|
||||
return handle;
|
||||
}
|
||||
|
||||
public void Unlock(IntPtr handle)
|
||||
{
|
||||
// no op
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user