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

data_request: Fix memory leak on prefetch getting ENOMEM

Samuel Thibault пре 4 година
родитељ
комит
b54df49e0a
1 измењених фајлова са 5 додато и 0 уклоњено
  1. 5 0
      src/datawizard/data_request.c

+ 5 - 0
src/datawizard/data_request.c

@@ -556,6 +556,11 @@ static int starpu_handle_data_request(struct _starpu_data_request *r, unsigned m
 	{
 		/* If there was not enough memory, we will try to redo the
 		 * request later. */
+
+		if (r->prefetch > STARPU_FETCH)
+			/* Drop ref until next try */
+			dst_replicate->refcnt--;
+
 		_starpu_spin_unlock(&handle->header_lock);
 		return -ENOMEM;
 	}