Преглед изворни кода

fix assertion: a request may have slipped through while unlocking the handle when allocating on the destination

Samuel Thibault пре 10 година
родитељ
комит
5dd0687128
1 измењених фајлова са 3 додато и 3 уклоњено
  1. 3 3
      src/datawizard/memalloc.c

+ 3 - 3
src/datawizard/memalloc.c

@@ -493,10 +493,10 @@ static size_t try_to_free_mem_chunk(struct _starpu_mem_chunk *mc, unsigned node)
 					/* mc is still associated with the old
 					 * handle, now free it.
 					 */
-					STARPU_ASSERT(handle->per_node[node].refcnt == 0);
 
-					/* now the actual buffer may be freed */
-					freed = do_free_mem_chunk(mc, node);
+					if (handle->per_node[node].refcnt == 0)
+						/* And still nobody on it, now the actual buffer may be freed */
+						freed = do_free_mem_chunk(mc, node);
 				}
 			}
 		}