From 5ea274be2c98f0315dea7278602263defac7932d Mon Sep 17 00:00:00 2001 From: Joseph Schuchart Date: Mon, 13 Jul 2020 08:22:23 +0200 Subject: [PATCH] Shmem: rename realloc/free in segment_allocator to avoid name clash with memory debugging Signed-off-by: Joseph Schuchart --- oshmem/mca/memheap/base/memheap_base_alloc.c | 2 +- oshmem/mca/sshmem/sshmem_types.h | 4 ++-- oshmem/mca/sshmem/ucx/sshmem_ucx_module.c | 4 ++-- oshmem/shmem/c/shmem_free.c | 2 +- oshmem/shmem/c/shmem_realloc.c | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/oshmem/mca/memheap/base/memheap_base_alloc.c b/oshmem/mca/memheap/base/memheap_base_alloc.c index 6b0f9c6caa9..eddffc023b4 100644 --- a/oshmem/mca/memheap/base/memheap_base_alloc.c +++ b/oshmem/mca/memheap/base/memheap_base_alloc.c @@ -84,7 +84,7 @@ int mca_memheap_alloc_with_hint(size_t size, long hint, void** ptr) /* Do not fall back to default allocator since it will break the * symmetry between PEs */ - return s->allocator->realloc(s, size, NULL, ptr); + return s->allocator->reallocate(s, size, NULL, ptr); } } diff --git a/oshmem/mca/sshmem/sshmem_types.h b/oshmem/mca/sshmem/sshmem_types.h index 4e1d937901a..6bcebc79702 100644 --- a/oshmem/mca/sshmem/sshmem_types.h +++ b/oshmem/mca/sshmem/sshmem_types.h @@ -124,8 +124,8 @@ typedef struct map_segment { } map_segment_t; struct segment_allocator { - int (*realloc)(map_segment_t*, size_t newsize, void *, void **); - int (*free)(map_segment_t*, void*); + int (*reallocate)(map_segment_t*, size_t newsize, void *, void **); + int (*release)(map_segment_t*, void*); }; END_C_DECLS diff --git a/oshmem/mca/sshmem/ucx/sshmem_ucx_module.c b/oshmem/mca/sshmem/ucx/sshmem_ucx_module.c index e108cd55ad5..30ba67dec5e 100644 --- a/oshmem/mca/sshmem/ucx/sshmem_ucx_module.c +++ b/oshmem/mca/sshmem/ucx/sshmem_ucx_module.c @@ -98,8 +98,8 @@ module_finalize(void) /* ////////////////////////////////////////////////////////////////////////// */ static segment_allocator_t sshmem_ucx_allocator = { - .realloc = sshmem_ucx_memheap_realloc, - .free = sshmem_ucx_memheap_free + .reallocate = sshmem_ucx_memheap_realloc, + .release = sshmem_ucx_memheap_free }; static int diff --git a/oshmem/shmem/c/shmem_free.c b/oshmem/shmem/c/shmem_free.c index eebdd537ab1..f406ba33b58 100644 --- a/oshmem/shmem/c/shmem_free.c +++ b/oshmem/shmem/c/shmem_free.c @@ -62,7 +62,7 @@ static inline void _shfree(void* ptr) } if (s && s->allocator) { - rc = s->allocator->free(s, ptr); + rc = s->allocator->release(s, ptr); } else { rc = MCA_MEMHEAP_CALL(free(ptr)); } diff --git a/oshmem/shmem/c/shmem_realloc.c b/oshmem/shmem/c/shmem_realloc.c index 7aab27735f5..cbb79b4555f 100644 --- a/oshmem/shmem/c/shmem_realloc.c +++ b/oshmem/shmem/c/shmem_realloc.c @@ -56,7 +56,7 @@ static inline void* _shrealloc(void *ptr, size_t size) } if (s && s->allocator) { - rc = s->allocator->realloc(s, size, ptr, &pBuff); + rc = s->allocator->reallocate(s, size, ptr, &pBuff); } else { rc = MCA_MEMHEAP_CALL(realloc(size, ptr, &pBuff)); }