Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.

Commit 88d8a8d

Browse files
committed
Merge pull request #975 from jsquyres/pr/v2.x/minor-memchecker-fix
v2.x: memchecker.h: fix memchecker no-data case
2 parents 980766e + b5d71a6 commit 88d8a8d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ompi/include/ompi/memchecker.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
* and Technology (RIST). All rights reserved.
1111
* Copyright (c) 2014 Intel, Inc. All rights reserved.
1212
*
13+
* Copyright (c) 2016 Cisco Systems, Inc. All rights reserved.
1314
* $COPYRIGHT$
1415
*
1516
* Additional copyrights may follow
@@ -100,6 +101,10 @@ static inline int memchecker_call (int (*f)(void *, size_t), const void * addr,
100101
return OMPI_SUCCESS;
101102
}
102103

104+
if ((0 == count) || (0 == datatype->super.size)) {
105+
return OMPI_SUCCESS;
106+
}
107+
103108
if( datatype->super.size == (size_t) (datatype->super.true_ub - datatype->super.true_lb) ) {
104109
/* We have a contiguous type. */
105110
f( (void*)addr , datatype->super.size * count );

0 commit comments

Comments
 (0)