Explorar o código

port r11508 from 1.1: Fix passing key to hasthable: the passed pointer has to be pointing to the key at all time

Samuel Thibault %!s(int64=11) %!d(string=hai) anos
pai
achega
d80744f490
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      src/datawizard/memalloc.c

+ 3 - 1
src/datawizard/memalloc.c

@@ -34,6 +34,7 @@ struct mc_cache_entry
 {
 	UT_hash_handle hh;
 	struct _starpu_mem_chunk_list *list;
+	uint32_t footprint;
 };
 static struct mc_cache_entry *mc_cache[STARPU_MAXNODES];
 
@@ -796,7 +797,8 @@ void _starpu_request_mem_chunk_removal(starpu_data_handle_t handle, struct _star
 		if (!entry) {
 			entry = malloc(sizeof(*entry));
 			entry->list = _starpu_mem_chunk_list_new();
-			HASH_ADD_KEYPTR(hh, mc_cache[node], &footprint, sizeof(footprint), entry);
+			entry->footprint = footprint;
+			HASH_ADD(hh, mc_cache[node], footprint, sizeof(entry->footprint), entry);
 		}
 		_starpu_mem_chunk_list_push_front(entry->list, mc);
 		_starpu_spin_unlock(&mc_lock[node]);