浏览代码

src/datawizard: function reclaim_memory_generic is now needed in another file

Nathalie Furmento 12 年之前
父节点
当前提交
29774f8bd4
共有 2 个文件被更改,包括 4 次插入3 次删除
  1. 3 3
      src/datawizard/memalloc.c
  2. 1 0
      src/datawizard/memalloc.h

+ 3 - 3
src/datawizard/memalloc.c

@@ -591,7 +591,7 @@ static size_t free_potentially_in_use_mc(unsigned node, unsigned force, size_t r
 	return freed;
 }
 
-static size_t reclaim_memory_generic(unsigned node, unsigned force, size_t reclaim)
+size_t _starpu_memory_reclaim_generic(unsigned node, unsigned force, size_t reclaim)
 {
 	size_t freed = 0;
 
@@ -619,7 +619,7 @@ static size_t reclaim_memory_generic(unsigned node, unsigned force, size_t recla
  */
 size_t _starpu_free_all_automatically_allocated_buffers(unsigned node)
 {
-	return reclaim_memory_generic(node, 1, 0);
+	return _starpu_memory_reclaim_generic(node, 1, 0);
 }
 
 static struct _starpu_mem_chunk *_starpu_memchunk_init(struct _starpu_data_replicate *replicate, size_t interface_size, unsigned automatically_allocated)
@@ -804,7 +804,7 @@ static ssize_t _starpu_allocate_interface(starpu_data_handle_t handle, struct _s
 				_STARPU_PTHREAD_RWLOCK_UNLOCK(&mc_rwlock[dst_node]);
 			}
 			else
-				reclaim_memory_generic(dst_node, 0, reclaim);
+				_starpu_memory_reclaim_generic(dst_node, 0, reclaim);
 			_STARPU_TRACE_END_MEMRECLAIM(dst_node);
 
 		        while (_starpu_spin_trylock(&handle->header_lock))

+ 1 - 0
src/datawizard/memalloc.h

@@ -69,5 +69,6 @@ size_t _starpu_free_all_automatically_allocated_buffers(unsigned node);
 void _starpu_memchunk_recently_used(struct _starpu_mem_chunk *mc, unsigned node);
 
 void _starpu_display_memory_stats_by_node(int node);
+size_t _starpu_memory_reclaim_generic(unsigned node, unsigned force, size_t reclaim);
 
 #endif