Skip to content

Commit 379a785

Browse files
authored
Merge pull request #141 from igchor/arena_dalloc
Implement arena_extent_dalloc in pool_jemalloc
2 parents 7872b23 + 86c23f3 commit 379a785

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/pool/pool_jemalloc.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,17 @@ static bool arena_extent_dalloc(extent_hooks_t *extent_hooks, void *addr,
111111
size_t size, bool committed,
112112
unsigned arena_ind) {
113113
(void)extent_hooks; // unused
114-
(void)addr; // unused
115-
(void)size; // unused
116114
(void)committed; // unused
117-
(void)arena_ind; // unused
118115

119-
return true; // true means failure (unsupported)
116+
jemalloc_memory_pool_t *pool = get_pool_by_arena_index(arena_ind);
117+
118+
umf_result_t ret;
119+
ret = umfMemoryProviderFree(pool->provider, addr, size);
120+
if (ret != UMF_RESULT_SUCCESS) {
121+
fprintf(stderr, "umfMemoryProviderFree failed in dalloc \n");
122+
}
123+
124+
return ret != UMF_RESULT_SUCCESS;
120125
}
121126

122127
// arena_extent_commit - an extent commit function conforms to the extent_commit_t type and commits

0 commit comments

Comments
 (0)