- temporarily revert obj reference count to non-atomic update
- fixed call to memory pool allocator This commit was SVN r1369.
Этот коммит содержится в:
родитель
6401dffd57
Коммит
39a341be52
@ -60,7 +60,7 @@ int ompi_free_list_grow(ompi_free_list_t* flist, size_t num_elements)
|
||||
return OMPI_ERR_TEMP_OUT_OF_RESOURCE;
|
||||
|
||||
if (NULL != flist->fl_mpool)
|
||||
ptr = (unsigned char*)flist->fl_mpool->mpool_alloc(flist->fl_mpool, num_elements * flist->fl_elem_size);
|
||||
ptr = (unsigned char*)flist->fl_mpool->mpool_alloc(num_elements * flist->fl_elem_size, 0);
|
||||
else
|
||||
ptr = malloc(num_elements * flist->fl_elem_size);
|
||||
if(NULL == ptr)
|
||||
|
@ -407,8 +407,9 @@ static inline ompi_object_t *ompi_obj_new(size_t size, ompi_class_t *cls)
|
||||
*/
|
||||
static inline int ompi_obj_update(ompi_object_t *object, int inc)
|
||||
{
|
||||
int oldval;
|
||||
int newval;
|
||||
#if 0
|
||||
int oldval;
|
||||
volatile int *addr;
|
||||
|
||||
addr = (volatile int *) &(object->obj_reference_count);
|
||||
@ -416,7 +417,10 @@ static inline int ompi_obj_update(ompi_object_t *object, int inc)
|
||||
oldval = *addr;
|
||||
newval = oldval + inc;
|
||||
} while (ompi_atomic_cmpset_int(addr, oldval, newval) == 0);
|
||||
|
||||
#else
|
||||
object->obj_reference_count += inc;
|
||||
newval = object->obj_reference_count;
|
||||
#endif
|
||||
return newval;
|
||||
}
|
||||
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user