Skip to content

Commit ba33907

Browse files
committed
Changes the memory allocator to use jemalloc to address memory leak issues.
1 parent 802dff9 commit ba33907

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

debian/control

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ Depends:
8888
gsettings-desktop-schemas,
8989
gvfs (>= 1.3.2),
9090
libglib2.0-data,
91+
libjemalloc2,
9192
libnemo-extension1 (= ${binary:Version}),
9293
nemo-data (= ${source:Version}),
9394
shared-mime-info (>= 0.50),

meson.build

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ cinnamon= dependency('cinnamon-desktop', version: '>=4.8.0')
8282
gail = dependency('gail-3.0')
8383
x11 = dependency('x11')
8484
xapp = dependency('xapp', version: '>=2.0.0')
85+
jemalloc = dependency('jemalloc', required: true)
8586

8687
# Facultative dependencies
8788

@@ -171,7 +172,8 @@ nemo_definitions = [
171172
'-DNEMO_DATADIR="@0@"'.format(nemoDataPath),
172173
'-DNEMO_EXTENSIONDIR="@0@"'.format(nemoExtensionPath),
173174
'-DLIBEXECDIR="@0@"'.format(libExecPath),
174-
'-DG_LOG_DOMAIN="Nemo"'
175+
'-DG_LOG_DOMAIN="Nemo"',
176+
'-DUSE_JEMALLOC'
175177
]
176178

177179
po_subdir = join_paths(meson.project_source_root(), 'po')

src/meson.build

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ if enableEmptyView
103103
endif
104104

105105
nemo_deps = [ cinnamon, gail, glib, gtk, math,
106-
egg, nemo_extension, nemo_private, xapp ]
106+
egg, nemo_extension, nemo_private, xapp, jemalloc ]
107107

108108
if exempi_enabled
109109
nemo_deps += exempi
@@ -118,6 +118,7 @@ nemo = executable('nemo',
118118
include_directories: [ rootInclude ],
119119
c_args: nemo_definitions,
120120
dependencies: nemo_deps,
121+
link_args: ['-Wl,--no-as-needed', '-ljemalloc', '-Wl,--as-needed'],
121122
install: true
122123
)
123124

@@ -126,6 +127,7 @@ nemoDesktop = executable('nemo-desktop',
126127
include_directories: [ rootInclude],
127128
c_args: nemo_definitions,
128129
dependencies: nemo_deps,
130+
link_args: ['-Wl,--no-as-needed', '-ljemalloc', '-Wl,--as-needed'],
129131
install: true
130132
)
131133

0 commit comments

Comments
 (0)