summaryrefslogtreecommitdiff
path: root/src/progs
diff options
context:
space:
mode:
Diffstat (limited to 'src/progs')
-rw-r--r--src/progs/dyecmd/actions/commands.cpp1
-rw-r--r--src/progs/manaplus/actions/commands.cpp15
2 files changed, 16 insertions, 0 deletions
diff --git a/src/progs/dyecmd/actions/commands.cpp b/src/progs/dyecmd/actions/commands.cpp
index 217aa5b53..5ee4d3089 100644
--- a/src/progs/dyecmd/actions/commands.cpp
+++ b/src/progs/dyecmd/actions/commands.cpp
@@ -163,5 +163,6 @@ impHandlerVoid(moveAttackDown)
impHandlerVoid(movePriorityAttackUp)
impHandlerVoid(movePriorityAttackDown)
impHandlerVoid(addSkillShortcut)
+impHandlerVoid(trimMemory)
} // namespace Actions
diff --git a/src/progs/manaplus/actions/commands.cpp b/src/progs/manaplus/actions/commands.cpp
index ff24d6bc3..57f5125b2 100644
--- a/src/progs/manaplus/actions/commands.cpp
+++ b/src/progs/manaplus/actions/commands.cpp
@@ -85,6 +85,8 @@
#include "utils/parameters.h"
#include "utils/process.h"
+#include <malloc.h>
+
#include "debug.h"
namespace Actions
@@ -2200,4 +2202,17 @@ impHandler(addSkillShortcut)
return true;
}
+impHandler0(trimMemory)
+{
+#ifdef HAVE_MALLOC_TRIM
+ malloc_trim(0);
+#else
+ localChatTab->chatLog(_("Trim memory not supported"),
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
+#endif
+ return true;
+}
+
} // namespace Actions