diff options
Diffstat (limited to 'Source/Core/Common/MemArena.cpp')
| -rw-r--r-- | Source/Core/Common/MemArena.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/Source/Core/Common/MemArena.cpp b/Source/Core/Common/MemArena.cpp index 699005dd52..e7f3911e91 100644 --- a/Source/Core/Common/MemArena.cpp +++ b/Source/Core/Common/MemArena.cpp @@ -6,7 +6,6 @@ #include "MemoryUtil.h" #include "MemArena.h" -#include "StringUtil.h" #ifdef _WIN32 #include <windows.h> @@ -58,21 +57,20 @@ void MemArena::GrabLowMemSpace(size_t size) return; } #else + char fn[64]; for (int i = 0; i < 10000; i++) { - std::string file_name = StringFromFormat("dolphinmem.%d", i); - fd = shm_open(file_name.c_str(), O_RDWR | O_CREAT | O_EXCL, 0600); + sprintf(fn, "dolphinmem.%d", i); + fd = shm_open(fn, O_RDWR | O_CREAT | O_EXCL, 0600); if (fd != -1) - { - shm_unlink(file_name.c_str()); break; - } - else if (errno != EEXIST) + if (errno != EEXIST) { ERROR_LOG(MEMMAP, "shm_open failed: %s", strerror(errno)); return; } } + shm_unlink(fn); if (ftruncate(fd, size) < 0) ERROR_LOG(MEMMAP, "Failed to allocate low memory space"); #endif |
