From c5a3a917f445e139f4e24acc0206a3f6a2b4d652 Mon Sep 17 00:00:00 2001 From: shahramn Date: Thu, 21 Nov 2024 15:49:10 +0000 Subject: [PATCH] ECC-1952: C API: Deprecate functions codes_context_set_memory_proc, codes_context_set_persistent_memory_proc and codes_context_set_buffer_memory_proc --- src/eccodes.cc | 16 ---------------- src/eccodes.h | 32 -------------------------------- src/eccodes_prototypes.h | 3 --- src/grib_api.h | 32 -------------------------------- src/grib_context.cc | 23 ----------------------- 5 files changed, 106 deletions(-) diff --git a/src/eccodes.cc b/src/eccodes.cc index d26644062..34ff02f8c 100644 --- a/src/eccodes.cc +++ b/src/eccodes.cc @@ -599,22 +599,6 @@ void codes_context_set_data_quality_checks(codes_context* c, int val) grib_context_set_data_quality_checks(c, val); } -void codes_context_set_memory_proc(codes_context* c, grib_malloc_proc p_malloc, grib_free_proc p_free, grib_realloc_proc p_realloc) -{ - // This function is deprecated and will later be removed - grib_context_set_memory_proc(c, p_malloc, p_free, p_realloc); -} -void codes_context_set_persistent_memory_proc(codes_context* c, grib_malloc_proc p_malloc, grib_free_proc p_free) -{ - // This function is deprecated and will later be removed - grib_context_set_persistent_memory_proc(c, p_malloc, p_free); -} -void codes_context_set_buffer_memory_proc(codes_context* c, grib_malloc_proc p_malloc, grib_free_proc p_free, grib_realloc_proc p_realloc) -{ - // This function is deprecated and will later be removed - grib_context_set_buffer_memory_proc(c, p_malloc, p_free, p_realloc); -} - void codes_context_set_print_proc(codes_context* c, grib_print_proc p_print) { grib_context_set_print_proc(c, p_print); diff --git a/src/eccodes.h b/src/eccodes.h index 46a048d43..06e440b1e 100644 --- a/src/eccodes.h +++ b/src/eccodes.h @@ -1177,38 +1177,6 @@ void codes_context_set_samples_path(codes_context* c, const char* path); void codes_context_set_debug(codes_context* c, int mode); void codes_context_set_data_quality_checks(codes_context* c, int val); -/** - * Sets memory procedures of the context - * - * @param c : the context to be modified - * @param p_malloc : the memory allocation procedure to be set @see codes_malloc_proc - * @param p_free : the memory freeing procedure to be set @see codes_free_proc - * @param p_realloc : the memory reallocation procedure to be set @see codes_realloc_proc - */ -void codes_context_set_memory_proc(codes_context* c, codes_malloc_proc p_malloc, - codes_free_proc p_free, codes_realloc_proc p_realloc) ECCODES_DEPRECATED; - -/** - * Sets memory procedures of the context for persistent data - * - * @param c : the context to be modified - * @param griballoc : the memory allocation procedure to be set @see codes_malloc_proc - * @param gribfree : the memory freeing procedure to be set @see codes_free_proc - */ -void codes_context_set_persistent_memory_proc(codes_context* c, codes_malloc_proc p_malloc, - codes_free_proc p_free) ECCODES_DEPRECATED; - -/** - * Sets memory procedures of the context for large buffers - * - * @param c : the context to be modified - * @param p_malloc : the memory allocation procedure to be set @see codes_malloc_proc - * @param p_free : the memory freeing procedure to be set @see codes_free_proc - * @param p_free : the memory reallocation procedure to be set @see codes_realloc_proc - */ -void codes_context_set_buffer_memory_proc(codes_context* c, codes_malloc_proc p_malloc, - codes_free_proc p_free, codes_realloc_proc p_realloc) ECCODES_DEPRECATED; - /** * Sets the context printing procedure used for user interaction * diff --git a/src/eccodes_prototypes.h b/src/eccodes_prototypes.h index a7e912ed1..3b4602cb1 100644 --- a/src/eccodes_prototypes.h +++ b/src/eccodes_prototypes.h @@ -434,9 +434,6 @@ void* grib_context_buffer_malloc(const grib_context* c, size_t size); void grib_context_buffer_free(const grib_context* c, void* p); void* grib_context_buffer_realloc(const grib_context* c, void* p, size_t size); void* grib_context_buffer_malloc_clear(const grib_context* c, size_t size); -void grib_context_set_memory_proc(grib_context* c, grib_malloc_proc m, grib_free_proc f, grib_realloc_proc r); -void grib_context_set_persistent_memory_proc(grib_context* c, grib_malloc_proc m, grib_free_proc f); -void grib_context_set_buffer_memory_proc(grib_context* c, grib_malloc_proc m, grib_free_proc f, grib_realloc_proc r); void grib_context_set_data_accessing_proc(grib_context* c, grib_data_read_proc read, grib_data_write_proc write, grib_data_tell_proc tell); void grib_context_log(const grib_context* c, int level, const char* fmt, ...); void grib_context_print(const grib_context* c, void* descriptor, const char* fmt, ...); diff --git a/src/grib_api.h b/src/grib_api.h index 4c633043f..7af58113b 100644 --- a/src/grib_api.h +++ b/src/grib_api.h @@ -1174,38 +1174,6 @@ void grib_context_set_samples_path(grib_context* c, const char* path); void grib_context_set_debug(grib_context* c, int mode); void grib_context_set_data_quality_checks(grib_context* c, int val); -/** - * Sets memory procedures of the context - * - * @param c : the context to be modified - * @param griballoc : the memory allocation procedure to be set @see grib_malloc_proc - * @param gribfree : the memory freeing procedure to be set @see grib_free_proc - */ -void grib_context_set_memory_proc(grib_context* c, grib_malloc_proc griballoc, - grib_free_proc gribfree, - grib_realloc_proc gribrealloc); - -/** - * Sets memory procedures of the context for persistent data - * - * @param c : the context to be modified - * @param griballoc : the memory allocation procedure to be set @see grib_malloc_proc - * @param gribfree : the memory freeing procedure to be set @see grib_free_proc - */ -void grib_context_set_persistent_memory_proc(grib_context* c, grib_malloc_proc griballoc, - grib_free_proc gribfree); - -/** - * Sets memory procedures of the context for large buffers - * - * @param c : the context to be modified - * @param griballoc : the memory allocation procedure to be set @see grib_malloc_proc - * @param gribfree : the memory freeing procedure to be set @see grib_free_proc - */ -void grib_context_set_buffer_memory_proc(grib_context* c, grib_malloc_proc griballoc, - grib_free_proc gribfree, - grib_realloc_proc gribrealloc); - /** * Sets the context printing procedure used for user interaction * diff --git a/src/grib_context.cc b/src/grib_context.cc index e600681ab..1b9a98d11 100644 --- a/src/grib_context.cc +++ b/src/grib_context.cc @@ -1026,29 +1026,6 @@ void* grib_context_buffer_malloc_clear(const grib_context* c, size_t size) return p; } -void grib_context_set_memory_proc(grib_context* c, grib_malloc_proc m, grib_free_proc f, grib_realloc_proc r) -{ - fprintf(stderr, "ECCODES WARNING : The %s function is deprecated and will be removed in a future release.\n", __func__); - c->free_mem = f; - c->alloc_mem = m; - c->realloc_mem = r; -} - -void grib_context_set_persistent_memory_proc(grib_context* c, grib_malloc_proc m, grib_free_proc f) -{ - fprintf(stderr, "ECCODES WARNING : The %s function is deprecated and will be removed in a future release.\n", __func__); - c->free_persistent_mem = f; - c->alloc_persistent_mem = m; -} - -void grib_context_set_buffer_memory_proc(grib_context* c, grib_malloc_proc m, grib_free_proc f, grib_realloc_proc r) -{ - fprintf(stderr, "ECCODES WARNING : The %s function is deprecated and will be removed in a future release.\n", __func__); - c->free_buffer_mem = f; - c->alloc_buffer_mem = m; - c->realloc_buffer_mem = r; -} - void grib_context_set_data_accessing_proc(grib_context* c, grib_data_read_proc read, grib_data_write_proc write, grib_data_tell_proc tell) { c->read = read;