瀏覽代碼

Fix free vs unregister order

Samuel Thibault 8 年之前
父節點
當前提交
63fbc7fa34
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      examples/stencil/implicit-stencil-blocks.c

+ 1 - 1
examples/stencil/implicit-stencil-blocks.c

@@ -276,8 +276,8 @@ static void free_block_on_node(starpu_data_handle_t handleptr, unsigned nx, unsi
 {
 	void *ptr = (void *) starpu_block_get_local_ptr(handleptr);
 	size_t block_size = nx*ny*nz*sizeof(TYPE);
-	starpu_free_flags(ptr, block_size, STARPU_MALLOC_PINNED|STARPU_MALLOC_SIMULATION_FOLDED);
 	starpu_data_unregister(handleptr);
+	starpu_free_flags(ptr, block_size, STARPU_MALLOC_PINNED|STARPU_MALLOC_SIMULATION_FOLDED);
 }
 
 void display_memory_consumption(int rank, double time)