summaryrefslogtreecommitdiff
path: root/Source/Core/Common/MemArena.cpp
diff options
context:
space:
mode:
authorPierre Bourdon <delroth@gmail.com>2014-02-09 16:12:59 +0100
committerPierre Bourdon <delroth@gmail.com>2014-02-09 16:14:13 +0100
commite59f770ccbf61f012d148a390e7f76775ab2a02e (patch)
tree4fd9c32775ca42490d8bf498e13049f4353c3037 /Source/Core/Common/MemArena.cpp
parent9da6900595318620690a5cdb5094a05e17cf094e (diff)
Revert "Merge pull request #49 from Parlane/sprintf_tidy"
Change broke the build on Debian stable. This reverts commit 28755439b36ac8e875d764da5db31ad693459ace, reversing changes made to 64e01ec763d21915e7166e625f8a3e85b46fbcbb.
Diffstat (limited to 'Source/Core/Common/MemArena.cpp')
-rw-r--r--Source/Core/Common/MemArena.cpp12
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