瀏覽代碼

Try and fix tests/datawizard/reclaim on i686.

Do not fail when no more memory can be allocated.
Cyril Roelandt 13 年之前
父節點
當前提交
cf33c6c1f1
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      tests/datawizard/reclaim.c

+ 6 - 1
tests/datawizard/reclaim.c

@@ -102,7 +102,12 @@ int main(int argc, char **argv)
 	for (i = 0; i < mb; i++)
 	{
 		host_ptr_array[i] = (float *) malloc(BLOCK_SIZE);
-		STARPU_ASSERT(host_ptr_array[i]);
+		if (host_ptr_array[i] == NULL)
+		{
+			mb = i;
+			fprintf(stderr, "Cannot allocate more than %d buffers\n", mb);
+			break;
+		}
 		starpu_variable_data_register(&handle_array[i], 0, (uintptr_t)host_ptr_array[i], BLOCK_SIZE);
 		STARPU_ASSERT(handle_array[i]);
 	}