1
1

in pointer_array_set_item and pointer_array_test_and_set_item, we did not update

the lowest_free field correctly, in case we just set exactly this value.

Reviewed by Tim.

This commit was SVN r1288.
Этот коммит содержится в:
Edgar Gabriel 2004-06-15 22:14:56 +00:00
родитель 6628da1299
Коммит 8e35c78e87

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

@ -217,6 +217,19 @@ int ompi_pointer_array_set_item(ompi_pointer_array_t *table, size_t index,
}
table->number_free++;
}
else {
/* Reset lowest_free if required */
if ( index == table->lowest_free ) {
size_t i;
for ( i=table->lowest_free; i<table->size; i++) {
if ( NULL == table->addr[i] ){
table->lowest_free = i;
break;
}
}
}
}
#if 0
ompi_output(0,"ompi_pointer_array_set_item: OUT: "
@ -289,6 +302,18 @@ int ompi_pointer_array_test_and_set_item (ompi_pointer_array_t *table, size_t in
*/
table->addr[index] = value;
/* Reset lowest_free if required */
if ( index == table->lowest_free ) {
size_t i;
for ( i=table->lowest_free; i<table->size; i++) {
if ( NULL == table->addr[i] ){
table->lowest_free = i;
break;
}
}
}
#if 0
ompi_output(0,"ompi_pointer_array_test_and_set_item: OUT: "
" table %p (size %ld, lowest free %ld, number free %ld)"