Skip to content

Commit 05456ea

Browse files
authored
Merge pull request #476 from ldorau/Use_base_global_allocator_in_the_proxy_pool
Use base global allocator in the proxy pool
2 parents d8f89cc + 96547d5 commit 05456ea

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/pool/pool_proxy.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
#include <umf/pools/pool_proxy.h>
1212

1313
#include <assert.h>
14-
#include <stdlib.h>
1514

15+
#include "base_alloc_global.h"
1616
#include "utils_common.h"
1717

1818
static __TLS umf_result_t TLS_last_allocation_error;
@@ -26,8 +26,8 @@ proxy_pool_initialize(umf_memory_provider_handle_t hProvider, void *params,
2626
void **ppPool) {
2727
(void)params; // unused
2828

29-
// TODO: use ba_alloc here
30-
struct proxy_memory_pool *pool = malloc(sizeof(struct proxy_memory_pool));
29+
struct proxy_memory_pool *pool =
30+
umf_ba_global_alloc(sizeof(struct proxy_memory_pool));
3131
if (!pool) {
3232
return UMF_RESULT_ERROR_OUT_OF_HOST_MEMORY;
3333
}
@@ -38,7 +38,7 @@ proxy_pool_initialize(umf_memory_provider_handle_t hProvider, void *params,
3838
return UMF_RESULT_SUCCESS;
3939
}
4040

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

4343
static void *proxy_aligned_malloc(void *pool, size_t size, size_t alignment) {
4444
assert(pool);

0 commit comments

Comments
 (0)