未验证 提交 2de881aa 编写于 作者: W wanghuancoder 提交者: GitHub

refine mmap allocator (#48511)

上级 0b2a66bb
......@@ -74,6 +74,7 @@ void AllocateMemoryMap(
"File descriptor %s open failed, unable in read-write mode",
filename.c_str()));
VLOG(6) << "shm_open: " << filename;
MemoryMapFdSet::Instance().Insert(filename);
}
} else {
fd = -1;
......@@ -171,11 +172,7 @@ void RefcountedMemoryMapAllocation::close() {
void *data = map_ptr_;
CountInfo *info = reinterpret_cast<CountInfo *>(data);
if (--info->refcount == 0) {
PADDLE_ENFORCE_NE(
shm_unlink(ipc_name_.c_str()),
-1,
platform::errors::Unavailable(
"could not unlink the shared memory file ", ipc_name_));
shm_unlink(ipc_name_.c_str());
VLOG(6) << "shm_unlink file: " << ipc_name_;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册