Skip to content

Commit cc61364

Browse files
committed
Fix return values from jemalloc hooks
For OS provider, merge, split and commits are nops. This means we should return false, not true from those hooks. Ref: https://github.com/memkind/memkind/blob/c425635feb0367c43da8fa0deadb50a4bc127988/src/memkind_arena.c
1 parent 2372e9f commit cc61364

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/pool/pool_jemalloc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ static bool arena_extent_commit(extent_hooks_t *extent_hooks, void *addr,
136136
(void)length; // unused
137137
(void)arena_ind; // unused
138138

139-
return true; // true means failure (unsupported)
139+
return false; // false means success (commit is a nop)
140140
}
141141

142142
// arena_extent_decommit - an extent decommit function conforms to the extent_decommit_t type
@@ -215,7 +215,7 @@ static bool arena_extent_split(extent_hooks_t *extent_hooks, void *addr,
215215
(void)committed; // unused
216216
(void)arena_ind; // unused
217217

218-
return true; // true means failure (unsupported)
218+
return false; // false means success (split is a nop)
219219
}
220220

221221
// arena_extent_merge - an extent merge function conforms to the extent_merge_t type and optionally
@@ -235,7 +235,7 @@ static bool arena_extent_merge(extent_hooks_t *extent_hooks, void *addr_a,
235235
(void)committed; // unused
236236
(void)arena_ind; // unused
237237

238-
return true; // true means failure (unsupported)
238+
return false; // false means success (merge is a nop)
239239
}
240240

241241
// The extent_hooks_t structure comprises function pointers which are described individually below.

0 commit comments

Comments
 (0)