Skip to content

Commit c4915cc

Browse files
committed
Change jemalloc prefix from je_ to je_umf_
Signed-off-by: Lukasz Dorau <[email protected]>
1 parent 7ae3029 commit c4915cc

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ else()
146146
add_custom_command(
147147
COMMAND
148148
./configure --prefix=${jemalloc_targ_BINARY_DIR}
149-
--with-jemalloc-prefix=je_ --disable-initial-exec-tls CFLAGS=-fPIC
150-
CXXFLAGS=-fPIC
149+
--with-jemalloc-prefix=je_umf_ --disable-initial-exec-tls
150+
CFLAGS=-fPIC CXXFLAGS=-fPIC
151151
WORKING_DIRECTORY ${jemalloc_targ_SOURCE_DIR}
152152
OUTPUT ${jemalloc_targ_SOURCE_DIR}/Makefile
153153
DEPENDS ${jemalloc_targ_SOURCE_DIR}/configure)

src/pool/pool_jemalloc.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ static void *op_malloc(void *pool, size_t size) {
349349
// MALLOCX_TCACHE_NONE is set, because jemalloc can mix objects from different arenas inside
350350
// the tcache, so we wouldn't be able to guarantee isolation of different providers.
351351
int flags = MALLOCX_ARENA(je_pool->arena_index) | MALLOCX_TCACHE_NONE;
352-
void *ptr = je_mallocx(size, flags);
352+
void *ptr = je_umf_mallocx(size, flags);
353353
if (ptr == NULL) {
354354
TLS_last_allocation_error = UMF_RESULT_ERROR_OUT_OF_HOST_MEMORY;
355355
return NULL;
@@ -366,7 +366,7 @@ static umf_result_t op_free(void *pool, void *ptr) {
366366

367367
if (ptr != NULL) {
368368
VALGRIND_DO_MEMPOOL_FREE(pool, ptr);
369-
je_dallocx(ptr, MALLOCX_TCACHE_NONE);
369+
je_umf_dallocx(ptr, MALLOCX_TCACHE_NONE);
370370
}
371371

372372
return UMF_RESULT_SUCCESS;
@@ -390,7 +390,7 @@ static void *op_calloc(void *pool, size_t num, size_t size) {
390390
static void *op_realloc(void *pool, void *ptr, size_t size) {
391391
assert(pool);
392392
if (size == 0 && ptr != NULL) {
393-
je_dallocx(ptr, MALLOCX_TCACHE_NONE);
393+
je_umf_dallocx(ptr, MALLOCX_TCACHE_NONE);
394394
TLS_last_allocation_error = UMF_RESULT_SUCCESS;
395395
VALGRIND_DO_MEMPOOL_FREE(pool, ptr);
396396
return NULL;
@@ -402,7 +402,7 @@ static void *op_realloc(void *pool, void *ptr, size_t size) {
402402
// MALLOCX_TCACHE_NONE is set, because jemalloc can mix objects from different arenas inside
403403
// the tcache, so we wouldn't be able to guarantee isolation of different providers.
404404
int flags = MALLOCX_ARENA(je_pool->arena_index) | MALLOCX_TCACHE_NONE;
405-
void *new_ptr = je_rallocx(ptr, size, flags);
405+
void *new_ptr = je_umf_rallocx(ptr, size, flags);
406406
if (new_ptr == NULL) {
407407
TLS_last_allocation_error = UMF_RESULT_ERROR_OUT_OF_HOST_MEMORY;
408408
return NULL;
@@ -427,7 +427,7 @@ static void *op_aligned_alloc(void *pool, size_t size, size_t alignment) {
427427
// the tcache, so we wouldn't be able to guarantee isolation of different providers.
428428
int flags =
429429
MALLOCX_ALIGN(alignment) | MALLOCX_ARENA(arena) | MALLOCX_TCACHE_NONE;
430-
void *ptr = je_mallocx(size, flags);
430+
void *ptr = je_umf_mallocx(size, flags);
431431
if (ptr == NULL) {
432432
TLS_last_allocation_error = UMF_RESULT_ERROR_OUT_OF_HOST_MEMORY;
433433
return NULL;
@@ -465,8 +465,8 @@ static umf_result_t op_initialize(umf_memory_provider_handle_t provider,
465465
}
466466

467467
unsigned arena_index;
468-
err = je_mallctl("arenas.create", (void *)&arena_index, &unsigned_size,
469-
NULL, 0);
468+
err = je_umf_mallctl("arenas.create", (void *)&arena_index, &unsigned_size,
469+
NULL, 0);
470470
if (err) {
471471
LOG_ERR("Could not create arena.");
472472
goto err_free_pool;
@@ -475,10 +475,10 @@ static umf_result_t op_initialize(umf_memory_provider_handle_t provider,
475475
// setup extent_hooks for newly created arena
476476
char cmd[64];
477477
snprintf(cmd, sizeof(cmd), "arena.%u.extent_hooks", arena_index);
478-
err = je_mallctl(cmd, NULL, NULL, (void *)&pHooks, sizeof(void *));
478+
err = je_umf_mallctl(cmd, NULL, NULL, (void *)&pHooks, sizeof(void *));
479479
if (err) {
480480
snprintf(cmd, sizeof(cmd), "arena.%u.destroy", arena_index);
481-
je_mallctl(cmd, NULL, 0, NULL, 0);
481+
je_umf_mallctl(cmd, NULL, 0, NULL, 0);
482482
LOG_ERR("Could not setup extent_hooks for newly created arena.");
483483
goto err_free_pool;
484484
}
@@ -502,7 +502,7 @@ static void op_finalize(void *pool) {
502502
jemalloc_memory_pool_t *je_pool = (jemalloc_memory_pool_t *)pool;
503503
char cmd[64];
504504
snprintf(cmd, sizeof(cmd), "arena.%u.destroy", je_pool->arena_index);
505-
je_mallctl(cmd, NULL, 0, NULL, 0);
505+
je_umf_mallctl(cmd, NULL, 0, NULL, 0);
506506
pool_by_arena_index[je_pool->arena_index] = NULL;
507507
umf_ba_global_free(je_pool);
508508

@@ -511,7 +511,7 @@ static void op_finalize(void *pool) {
511511

512512
static size_t op_malloc_usable_size(void *pool, void *ptr) {
513513
(void)pool; // not used
514-
return je_malloc_usable_size(ptr);
514+
return je_umf_malloc_usable_size(ptr);
515515
}
516516

517517
static umf_result_t op_get_last_allocation_error(void *pool) {

0 commit comments

Comments
 (0)