Skip to content

Commit 51122d2

Browse files
committed
Use base global allocator in the proxy pool
Signed-off-by: Lukasz Dorau <[email protected]>
1 parent ac2ae9e commit 51122d2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/pool/pool_proxy.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <assert.h>
1414
#include <stdlib.h>
1515

16+
#include "base_alloc_global.h"
1617
#include "utils_common.h"
1718

1819
static __TLS umf_result_t TLS_last_allocation_error;
@@ -26,8 +27,8 @@ proxy_pool_initialize(umf_memory_provider_handle_t hProvider, void *params,
2627
void **ppPool) {
2728
(void)params; // unused
2829

29-
// TODO: use ba_alloc here
30-
struct proxy_memory_pool *pool = malloc(sizeof(struct proxy_memory_pool));
30+
struct proxy_memory_pool *pool =
31+
umf_ba_global_alloc(sizeof(struct proxy_memory_pool));
3132
if (!pool) {
3233
return UMF_RESULT_ERROR_OUT_OF_HOST_MEMORY;
3334
}
@@ -38,7 +39,7 @@ proxy_pool_initialize(umf_memory_provider_handle_t hProvider, void *params,
3839
return UMF_RESULT_SUCCESS;
3940
}
4041

41-
static void proxy_pool_finalize(void *pool) { free(pool); }
42+
static void proxy_pool_finalize(void *pool) { umf_ba_global_free(pool); }
4243

4344
static void *proxy_aligned_malloc(void *pool, size_t size, size_t alignment) {
4445
assert(pool);

0 commit comments

Comments
 (0)