1
1

A change to the ompi_list system that *should* be transparent. It shows no affect on anything in the unit test, and works with everything I have used to test it.

The change is to the destructor for ompi_list_t - it now cleans releases all objects attached to the list. Before this change, you had to be careful to run the list of items yourself, releasing all of them, before calling OBJ_DESTRUCT on the head of the list - or else "leak" all the item memory. With this change, you don't have to do that yourself. The destructor takes care of it for you.

Please let me know if anyone observes undesirable behavior from the change.
Ralph

This commit was SVN r2421.
Этот коммит содержится в:
Ralph Castain 2004-08-31 20:52:18 +00:00
родитель 50fbf1d184
Коммит 81a79e27f3

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

@ -71,6 +71,12 @@ static void ompi_list_construct(ompi_list_t *list)
*/
static void ompi_list_destruct(ompi_list_t *list)
{
ompi_list_item_t *item;
while (NULL != (item = ompi_list_remove_first(list))) {
OBJ_RELEASE(item);
}
ompi_list_construct(list);
}
@ -82,7 +88,7 @@ bool ompi_list_insert(ompi_list_t *list, ompi_list_item_t *item, long long idx)
{
/* Adds item to list at index and retains item. */
int i;
volatile ompi_list_item_t *ptr, *next;
volatile ompi_list_item_t *ptr, *next;
if ( idx >= list->ompi_list_length ) {
return false;
@ -116,7 +122,7 @@ void
ompi_list_transfer(ompi_list_item_t *pos, ompi_list_item_t *begin,
ompi_list_item_t *end)
{
ompi_list_item_t *tmp;
volatile ompi_list_item_t *tmp;
if (pos != end) {
/* remove [begin, end) */