Commit f8afd43c authored by Philip Carns's avatar Philip Carns
Browse files

add context argument to read_raw_free()

- will allow backends to take into account runtime parameters or other
  state in memory allocation/deallocation
parent bae69042
...@@ -32,7 +32,7 @@ typedef int (*bake_write_bulk_fn)(backend_context_t context, ...@@ -32,7 +32,7 @@ typedef int (*bake_write_bulk_fn)(backend_context_t context,
hg_addr_t source, hg_addr_t source,
size_t bulk_offset); size_t bulk_offset);
typedef void (*free_fn)(void*); typedef void (*free_fn)(backend_context_t context, void*);
typedef int (*bake_read_raw_fn)(backend_context_t context, typedef int (*bake_read_raw_fn)(backend_context_t context,
bake_region_id_t rid, bake_region_id_t rid,
......
...@@ -431,7 +431,7 @@ static int bake_file_write_bulk(backend_context_t context, ...@@ -431,7 +431,7 @@ static int bake_file_write_bulk(backend_context_t context,
* bake_file_read_raw(). It is like a normal fre() except that it must * bake_file_read_raw(). It is like a normal fre() except that it must
* round down to block alignment to find the correct pointer to free. * round down to block alignment to find the correct pointer to free.
*/ */
static void bake_file_read_raw_free(void* ptr) static void bake_file_read_raw_free(backend_context_t context, void* ptr)
{ {
free((void*)(BAKE_ALIGN_DOWN(ptr))); free((void*)(BAKE_ALIGN_DOWN(ptr)));
return; return;
......
...@@ -778,7 +778,7 @@ static void bake_eager_read_ult(hg_handle_t handle) ...@@ -778,7 +778,7 @@ static void bake_eager_read_ult(hg_handle_t handle)
finish: finish:
UNLOCK_PROVIDER; UNLOCK_PROVIDER;
RESPOND_AND_CLEANUP; RESPOND_AND_CLEANUP;
if (free_data) free_data(out.buffer); if (free_data) free_data(target->context, out.buffer);
} }
DEFINE_MARGO_RPC_HANDLER(bake_eager_read_ult) DEFINE_MARGO_RPC_HANDLER(bake_eager_read_ult)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment