Move the if around the for loop.
Don't release memory that has not been allocated by the freelist. This commit was SVN r20530.
Этот коммит содержится в:
родитель
883a0972bc
Коммит
a0248f736c
@ -1,8 +1,9 @@
|
|||||||
|
/* -*- Mode: C; c-basic-offset:4 ; -*- */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||||
* University Research and Technology
|
* University Research and Technology
|
||||||
* Corporation. All rights reserved.
|
* Corporation. All rights reserved.
|
||||||
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
* Copyright (c) 2004-2009 The University of Tennessee and The University
|
||||||
* of Tennessee Research Foundation. All rights
|
* of Tennessee Research Foundation. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||||
@ -68,24 +69,22 @@ static void ompi_free_list_destruct(ompi_free_list_t* fl)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if( NULL != fl->fl_mpool ) {
|
||||||
while(NULL != (item = opal_list_remove_first(&(fl->fl_allocations)))) {
|
while(NULL != (item = opal_list_remove_first(&(fl->fl_allocations)))) {
|
||||||
fl_mem = (ompi_free_list_memory_t*)item;
|
fl_mem = (ompi_free_list_memory_t*)item;
|
||||||
if(fl->fl_mpool != NULL) {
|
|
||||||
fl->fl_mpool->mpool_free(fl->fl_mpool, fl_mem->ptr,
|
fl->fl_mpool->mpool_free(fl->fl_mpool, fl_mem->ptr,
|
||||||
fl_mem->registration);
|
fl_mem->registration);
|
||||||
}
|
|
||||||
/* destruct the item (we constructed it), then free the memory chunk */
|
/* destruct the item (we constructed it), then free the memory chunk */
|
||||||
OBJ_DESTRUCT(item);
|
OBJ_DESTRUCT(item);
|
||||||
free(item);
|
free(item);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
OBJ_DESTRUCT(&fl->fl_allocations);
|
OBJ_DESTRUCT(&fl->fl_allocations);
|
||||||
OBJ_DESTRUCT(&fl->fl_condition);
|
OBJ_DESTRUCT(&fl->fl_condition);
|
||||||
OBJ_DESTRUCT(&fl->fl_lock);
|
OBJ_DESTRUCT(&fl->fl_lock);
|
||||||
if(fl->ctx) {
|
|
||||||
free(fl->ctx);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int ompi_free_list_init_ex(
|
int ompi_free_list_init_ex(
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user