- Have two separate versions of OBJ_RETAIN and OBJ_RELEASE to
get readable preprocessed output. This commit was SVN r12162.
Этот коммит содержится в:
родитель
be27ee6fa0
Коммит
528329c30f
@ -5,7 +5,7 @@
|
|||||||
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
||||||
* of Tennessee Research Foundation. All rights
|
* of Tennessee Research Foundation. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
* Copyright (c) 2004-2006 High Performance Computing Center Stuttgart,
|
||||||
* University of Stuttgart. All rights reserved.
|
* University of Stuttgart. All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
@ -254,13 +254,16 @@ static inline opal_object_t *opal_obj_new_debug(opal_class_t* type, const char*
|
|||||||
*
|
*
|
||||||
* @param object Pointer to the object
|
* @param object Pointer to the object
|
||||||
*/
|
*/
|
||||||
|
#if OMPI_ENABLE_DEBUG
|
||||||
#define OBJ_RETAIN(object) \
|
#define OBJ_RETAIN(object) \
|
||||||
do { \
|
do { \
|
||||||
assert(NULL != object); \
|
|
||||||
assert(NULL != ((opal_object_t *) (object))->obj_class); \
|
assert(NULL != ((opal_object_t *) (object))->obj_class); \
|
||||||
opal_obj_update((opal_object_t *) (object), 1); \
|
opal_obj_update((opal_object_t *) (object), 1); \
|
||||||
assert(((opal_object_t *) (object))->obj_reference_count >= 0); \
|
assert(((opal_object_t *) (object))->obj_reference_count >= 0); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
#else
|
||||||
|
#define OBJ_RETAIN(object) opal_obj_update((opal_object_t *) (object), 1);
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper macro for the debug mode to store the locations where the status of
|
* Helper macro for the debug mode to store the locations where the status of
|
||||||
@ -286,9 +289,9 @@ static inline opal_object_t *opal_obj_new_debug(opal_class_t* type, const char*
|
|||||||
*
|
*
|
||||||
* @param object Pointer to the object
|
* @param object Pointer to the object
|
||||||
*/
|
*/
|
||||||
|
#if OMPI_ENABLE_DEBUG
|
||||||
#define OBJ_RELEASE(object) \
|
#define OBJ_RELEASE(object) \
|
||||||
do { \
|
do { \
|
||||||
assert(NULL != object); \
|
|
||||||
assert(NULL != ((opal_object_t *) (object))->obj_class); \
|
assert(NULL != ((opal_object_t *) (object))->obj_class); \
|
||||||
if (0 == opal_obj_update((opal_object_t *) (object), -1)) { \
|
if (0 == opal_obj_update((opal_object_t *) (object), -1)) { \
|
||||||
opal_obj_run_destructors((opal_object_t *) (object)); \
|
opal_obj_run_destructors((opal_object_t *) (object)); \
|
||||||
@ -297,6 +300,16 @@ static inline opal_object_t *opal_obj_new_debug(opal_class_t* type, const char*
|
|||||||
object = NULL; \
|
object = NULL; \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
#else
|
||||||
|
#define OBJ_RELEASE(object) \
|
||||||
|
do { \
|
||||||
|
if (0 == opal_obj_update((opal_object_t *) (object), -1)) { \
|
||||||
|
opal_obj_run_destructors((opal_object_t *) (object)); \
|
||||||
|
free(object); \
|
||||||
|
object = NULL; \
|
||||||
|
} \
|
||||||
|
} while (0)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user