1
1

Make ompi_datatype_destroy a real function (instead of inline).

This commit was SVN r24462.
Этот коммит содержится в:
George Bosilca 2011-02-25 00:37:52 +00:00
родитель 4184baa67a
Коммит c66e454181
2 изменённых файлов: 17 добавлений и 17 удалений

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

@ -1,6 +1,6 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */ /* -*- Mode: C; c-basic-offset:4 ; -*- */
/* /*
* Copyright (c) 2009 The University of Tennessee and The University * Copyright (c) 2009-2010 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights * of Tennessee Research Foundation. All rights
* reserved. * reserved.
* Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. * Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
@ -159,18 +159,7 @@ ompi_datatype_commit( ompi_datatype_t ** type )
} }
static inline int32_t OMPI_DECLSPEC int32_t ompi_datatype_destroy( ompi_datatype_t** type);
ompi_datatype_destroy( ompi_datatype_t** type)
{
ompi_datatype_t* pData = *type;
if( ompi_datatype_is_predefined(pData) && (pData->super.super.obj_reference_count <= 1) )
return OMPI_ERROR;
OBJ_RELEASE( pData );
*type = NULL;
return OMPI_SUCCESS;
}
/* /*
@ -193,7 +182,7 @@ ompi_datatype_duplicate( const ompi_datatype_t* oldType, ompi_datatype_t** newTy
if( NULL == new_ompi_datatype ) { if( NULL == new_ompi_datatype ) {
return OMPI_ERR_OUT_OF_RESOURCE; return OMPI_ERR_OUT_OF_RESOURCE;
} }
opal_datatype_clone ( &oldType->super, &new_ompi_datatype->super); opal_datatype_clone( &oldType->super, &new_ompi_datatype->super);
/* Strip the predefined flag at the OMPI level. */ /* Strip the predefined flag at the OMPI level. */
new_ompi_datatype->super.flags &= ~OMPI_DATATYPE_FLAG_PREDEFINED; new_ompi_datatype->super.flags &= ~OMPI_DATATYPE_FLAG_PREDEFINED;

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

@ -3,7 +3,7 @@
* Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana * Copyright (c) 2004-2006 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-2009 The University of Tennessee and The University * Copyright (c) 2004-2010 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights * of Tennessee Research Foundation. All rights
* reserved. * reserved.
* Copyright (c) 2004-2006 High Performance Computing Center Stuttgart, * Copyright (c) 2004-2006 High Performance Computing Center Stuttgart,
@ -29,7 +29,6 @@
#include "ompi/datatype/ompi_datatype.h" #include "ompi/datatype/ompi_datatype.h"
#include "ompi/attribute/attribute.h" #include "ompi/attribute/attribute.h"
static void __ompi_datatype_allocate( ompi_datatype_t* datatype ) static void __ompi_datatype_allocate( ompi_datatype_t* datatype )
{ {
datatype->args = NULL; datatype->args = NULL;
@ -70,9 +69,21 @@ ompi_datatype_t * ompi_datatype_create( int32_t expectedSize )
int ret; int ret;
ompi_datatype_t * datatype = (ompi_datatype_t*)OBJ_NEW(ompi_datatype_t); ompi_datatype_t * datatype = (ompi_datatype_t*)OBJ_NEW(ompi_datatype_t);
ret = opal_datatype_create_desc ( &(datatype->super), expectedSize); ret = opal_datatype_create_desc( &(datatype->super), expectedSize);
if (OPAL_SUCCESS != ret) if (OPAL_SUCCESS != ret)
return NULL; return NULL;
return datatype; return datatype;
} }
int32_t ompi_datatype_destroy( ompi_datatype_t** type)
{
ompi_datatype_t* pData = *type;
if( ompi_datatype_is_predefined(pData) && (pData->super.super.obj_reference_count <= 1) )
return OMPI_ERROR;
OBJ_RELEASE(pData);
*type = NULL;
return OMPI_SUCCESS;
}