1
1

rcache/vma: fix module finalization memory leaks

Reviewed-by: Jeff Squyres <jsquyres@cisco.com>

This commit was SVN r29486.
Этот коммит содержится в:
Dave Goodell 2013-10-23 15:51:44 +00:00
родитель d969cfa513
Коммит 647e5a6fd2
3 изменённых файлов: 20 добавлений и 1 удалений

Просмотреть файл

@ -10,7 +10,7 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Voltaire. All rights reserved.
* Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2009-2013 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2009 IBM Corporation. All rights reserved.
* Copyright (c) 2013 NVIDIA Corporation. All rights reserved.
*
@ -169,6 +169,9 @@ int mca_rcache_vma_clean(struct mca_rcache_base_module_t* rcache)
*/
void mca_rcache_vma_finalize(struct mca_rcache_base_module_t* rcache)
{
OBJ_DESTRUCT(&rcache->lock);
mca_rcache_vma_tree_finalize((mca_rcache_vma_module_t *)rcache);
free(rcache);
}
void mca_rcache_vma_dump_range(struct mca_rcache_base_module_t* rcache,

Просмотреть файл

@ -16,6 +16,7 @@
* Copyright (c) 2009 IBM Corporation. All rights reserved.
* Copyright (c) 2013 NVIDIA Corporation. All rights reserved.
*
* Copyright (c) 2013 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -266,6 +267,15 @@ int mca_rcache_vma_tree_init(mca_rcache_vma_module_t* rcache)
mca_rcache_vma_tree_node_compare);
}
void mca_rcache_vma_tree_finalize(mca_rcache_vma_module_t* rcache)
{
ompi_rb_tree_init(&rcache->rb_tree,
mca_rcache_vma_tree_node_compare);
OBJ_DESTRUCT(&rcache->vma_delete_list);
OBJ_DESTRUCT(&rcache->vma_list);
OBJ_DESTRUCT(&rcache->rb_tree);
}
mca_mpool_base_registration_t *mca_rcache_vma_tree_find(
mca_rcache_vma_module_t* vma_rcache, unsigned char *base,
unsigned char *bound)

Просмотреть файл

@ -14,6 +14,7 @@
* Copyright (c) 2006 Voltaire. All rights reserved.
* Copyright (c) 2009 IBM Corporation. All rights reserved.
*
* Copyright (c) 2013 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -63,6 +64,11 @@ OBJ_CLASS_DECLARATION(mca_rcache_vma_t);
*/
int mca_rcache_vma_tree_init(mca_rcache_vma_module_t* rcache);
/*
* clean up the vma tree
*/
void mca_rcache_vma_tree_finalize(mca_rcache_vma_module_t* rcache);
/**
* Returns the item in the vma tree
*/