aboutsummaryrefslogtreecommitdiff
path: root/libitm/dispatch.h
diff options
context:
space:
mode:
authorTorvald Riegel <triegel@redhat.com>2012-03-05 16:34:12 +0000
committerTorvald Riegel <torvald@gcc.gnu.org>2012-03-05 16:34:12 +0000
commitd28b0b0861af105bb15a5ed60488469a0dcbeb67 (patch)
tree4cf06fc2f46eedd93cb75822cf369c5e2dd7c844 /libitm/dispatch.h
parent034209bc2fc3ca7ebec8ec3d28b94fbb9d00029d (diff)
downloadgcc-d28b0b0861af105bb15a5ed60488469a0dcbeb67.zip
gcc-d28b0b0861af105bb15a5ed60488469a0dcbeb67.tar.gz
gcc-d28b0b0861af105bb15a5ed60488469a0dcbeb67.tar.bz2
libitm: Don't execute memtransfer/memset if size isn't larger than zero.
libitm/ * dispatch.h (CREATE_DISPATCH_METHODS_MEM): Don't execute memtransfer/memset if size isn't larger than zero. From-SVN: r184941
Diffstat (limited to 'libitm/dispatch.h')
-rw-r--r--libitm/dispatch.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/libitm/dispatch.h b/libitm/dispatch.h
index d059c49..6a9e62e 100644
--- a/libitm/dispatch.h
+++ b/libitm/dispatch.h
@@ -102,11 +102,13 @@
virtual void memtransfer(void *dst, const void* src, size_t size, \
bool may_overlap, ls_modifier dst_mod, ls_modifier src_mod) \
{ \
- memtransfer_static(dst, src, size, may_overlap, dst_mod, src_mod); \
+ if (size > 0) \
+ memtransfer_static(dst, src, size, may_overlap, dst_mod, src_mod); \
} \
virtual void memset(void *dst, int c, size_t size, ls_modifier mod) \
{ \
- memset_static(dst, c, size, mod); \
+ if (size > 0) \
+ memset_static(dst, c, size, mod); \
}
#define CREATE_DISPATCH_METHODS_MEM_PV() \