1
1

opal_free_list: destruct free lists items when destructing the free

list

This commit updates the behavior of opal_free_list_t to match the
behavior of ompi_free_list_t. opal_free_list_t constructed items
placed on the free list but never destructed them.

cmr=v1.8.2:reviewer=jsquyres

This commit was SVN r31764.
Этот коммит содержится в:
Nathan Hjelm 2014-05-14 21:15:19 +00:00
родитель ad0e8f841d
Коммит 13fd6ae774

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

@ -1,3 +1,4 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
@ -10,6 +11,8 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2014 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -50,6 +53,14 @@ static void opal_free_list_destruct(opal_free_list_t* fl)
{
opal_list_item_t *item;
if (fl->fl_elem_class) {
OPAL_LIST_FOREACH(item, &fl->super, opal_list_item_t) {
/* destruct the item (we constructed it), the underlying memory will be
* reclaimed when we free the slab below */
OBJ_DESTRUCT(item);
}
}
while (NULL != (item = opal_list_remove_first(&(fl->fl_allocations)))) {
/* destruct the item (we constructed it), then free the memory chunk */
OBJ_DESTRUCT(item);