Remove unnecessary file
This commit is contained in:
parent
ec9931e09e
commit
aeb4f8e852
@ -1,26 +0,0 @@
|
||||
#include "memory.h"
|
||||
#include <sys/mman.h>
|
||||
#include <errno.h>
|
||||
#include <stdexcept>
|
||||
#include <cpp-utils/logging/logging.h>
|
||||
|
||||
using namespace cpputils::logging;
|
||||
|
||||
namespace cpputils {
|
||||
|
||||
DontSwapMemoryRAII::DontSwapMemoryRAII(const void *addr, size_t len)
|
||||
: addr_(addr), len_(len) {
|
||||
const int result = ::mlock(addr_, len_);
|
||||
if (0 != result) {
|
||||
throw std::runtime_error("Error calling mlock. Errno: " + std::to_string(errno));
|
||||
}
|
||||
}
|
||||
|
||||
DontSwapMemoryRAII::~DontSwapMemoryRAII() {
|
||||
const int result = ::munlock(addr_, len_);
|
||||
if (0 != result) {
|
||||
LOG(WARN, "Error calling munlock. Errno: {}", errno);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user