Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Konsole
Commits
38fc4569
Commit
38fc4569
authored
Nov 20, 2021
by
Kurt Hindenburg
Browse files
Add malloc.h check; fixes build on macos
Tested on kubuntu and freebsd
parent
7e42fcc2
Pipeline
#99472
passed with stage
in 1 minute and 53 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
38fc4569
...
...
@@ -39,6 +39,7 @@ include(ECMQtDeclareLoggingCategory)
include
(
KDEClangFormat
)
# Remove OPTIONAL when we require EMC >= 5.79
include
(
KDEGitCommitHooks OPTIONAL
)
include
(
CheckIncludeFiles
)
# Allows passing e.g. -DECM_ENABLE_SANITIZERS='address;undefined' to cmake.
include
(
ECMEnableSanitizers
)
...
...
@@ -93,6 +94,8 @@ set(HAVE_X11 ${X11_FOUND})
# Check for function GETPWUID
check_symbol_exists
(
getpwuid
"pwd.h"
HAVE_GETPWUID
)
check_include_files
(
malloc.h HAVE_MALLOC_H
)
# See above includes for defaults
add_definitions
(
-DQT_NO_FOREACH
...
...
src/Screen.cpp
View file @
38fc4569
...
...
@@ -8,6 +8,8 @@
// Own
#include
"Screen.h"
#include
"config-konsole.h"
// Qt
#include
<QTextStream>
...
...
@@ -27,11 +29,13 @@
#include
"profile/Profile.h"
#include
"profile/ProfileManager.h"
// For malloc_trim, which is a GNU extension
#ifdef __GNUC__
extern
"C"
{
#include
<malloc.h>
}
#ifdef HAVE_MALLOC_H
// For malloc_trim, which is a GNU extension
#ifdef __GNUC__
extern
"C"
{
#include
<malloc.h>
#endif
}
#endif
using
namespace
Konsole
;
...
...
@@ -1703,12 +1707,14 @@ void Screen::setScroll(const HistoryType &t, bool copyPreviousScroll)
t
.
scroll
(
_history
);
}
#ifdef HAVE_MALLOC_H
#ifdef Q_OS_LINUX
#ifdef __GNUC__
// We might have been using gigabytes of memory, so make sure it is actually released
malloc_trim
(
0
);
#endif
#endif
#endif
}
bool
Screen
::
hasScroll
()
const
...
...
src/config-konsole.h.cmake
View file @
38fc4569
...
...
@@ -11,3 +11,6 @@
#cmakedefine USE_TERMINALINTERFACEV2
#cmakedefine HAVE_GETPWUID ${HAVE_GETPWUID}
/* Define to 1 if you have the <malloc.h> header file. */
#cmakedefine HAVE_MALLOC_H 1
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment