Pārlūkot izejas kodu

There is no need to keep a local copy of the "interface" within the memory
chunk structure since its already available with the handle, which is stored in
the memory chunk structure too.

Cédric Augonnet 16 gadi atpakaļ
vecāks
revīzija
4288eb2a81
2 mainītis faili ar 4 papildinājumiem un 8 dzēšanām
  1. 4 7
      src/datawizard/memalloc.c
  2. 0 1
      src/datawizard/memalloc.h

+ 4 - 7
src/datawizard/memalloc.c

@@ -250,11 +250,9 @@ static void reuse_mem_chunk(unsigned node, data_state *new_data, mem_chunk_t mc,
 	new_data->per_node[node].allocated = 1;
 	new_data->per_node[node].automatically_allocated = 1;
 
-	memcpy(&new_data->interface[node], &mc->interface, sizeof(starpu_data_interface_t));
-
 	mc->data = new_data;
 	mc->data_was_deleted = 0;
-	/* mc->ops, mc->size, mc->footprint and mc->interface should be
+	/* mc->ops, mc->size and mc->footprint should be
  	 * unchanged ! */
 	
 	/* reinsert the mem chunk in the list of active memory chunks */
@@ -427,9 +425,6 @@ static void register_mem_chunk(data_state *state, uint32_t dst_node, size_t size
 	mc->data_was_deleted = 0;
 	mc->automatically_allocated = automatically_allocated;
 
-	/* the interface was already filled by ops->allocate_data_on_node */
-	memcpy(&mc->interface, &state->interface[dst_node], sizeof(starpu_data_interface_t));
-
 	res = pthread_rwlock_wrlock(&mc_rwlock[dst_node]);
 	STARPU_ASSERT(!res);
 
@@ -494,7 +489,9 @@ static size_t liberate_memory_on_node(mem_chunk_t mc, uint32_t node)
 	{
 		STARPU_ASSERT(state->per_node[node].allocated);
 
-		mc->ops->liberate_data_on_node(&mc->interface, node);
+		starpu_data_interface_t *interface =
+			starpu_data_get_interface_on_node(state, node);
+		mc->ops->liberate_data_on_node(interface, node);
 
 		if (!mc->data_was_deleted)
 		{

+ 0 - 1
src/datawizard/memalloc.h

@@ -38,7 +38,6 @@ LIST_TYPE(mem_chunk,
 	 * because when a data is deleted, the memory chunk remains.
 	 */
 	struct data_interface_ops_t *ops;
-	starpu_data_interface_t interface;
 	unsigned automatically_allocated;
 	unsigned data_was_deleted;
 )