Browse Source

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 11 years ago
parent
commit
d80744f490
1 changed files with 3 additions and 1 deletions
  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;
 	UT_hash_handle hh;
 	struct _starpu_mem_chunk_list *list;
 	struct _starpu_mem_chunk_list *list;
+	uint32_t footprint;
 };
 };
 static struct mc_cache_entry *mc_cache[STARPU_MAXNODES];
 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) {
 		if (!entry) {
 			entry = malloc(sizeof(*entry));
 			entry = malloc(sizeof(*entry));
 			entry->list = _starpu_mem_chunk_list_new();
 			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_mem_chunk_list_push_front(entry->list, mc);
 		_starpu_spin_unlock(&mc_lock[node]);
 		_starpu_spin_unlock(&mc_lock[node]);