Can you stop memory from being swapped to disk?

后端 未结 7 1024
北恋
北恋 2021-01-02 02:59

I was wondering if it was possible to prevent memory of a object (class or struct) from being swapped to disk?

Edit: As for why I\'ve been told some of the data I\'m

7条回答
  •  情书的邮戳
    2021-01-02 03:40

    I'd do something totally different:

    Build a nice native wrapping C++ DLL with your desired functions/allocations/whatever which will also make sure the data isn't get swapped (VirtualLock as someone said here). Use it from C#.

    After all, natively it's possible, it's just that you're now bound to C#. So, get around it!

提交回复
热议问题