Skip to content

Commit

Permalink
ECC-1952: C API: Deprecate functions codes_context_set_memory_proc, c…
Browse files Browse the repository at this point in the history
…odes_context_set_persistent_memory_proc and codes_context_set_buffer_memory_proc
  • Loading branch information
shahramn committed Nov 21, 2024
1 parent 90f41b1 commit c5a3a91
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 106 deletions.
16 changes: 0 additions & 16 deletions src/eccodes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
32 changes: 0 additions & 32 deletions src/eccodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
3 changes: 0 additions & 3 deletions src/eccodes_prototypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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, ...);
Expand Down
32 changes: 0 additions & 32 deletions src/grib_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
23 changes: 0 additions & 23 deletions src/grib_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c5a3a91

Please sign in to comment.