summaryrefslogtreecommitdiffstats
path: root/openmp/runtime/src
diff options
context:
space:
mode:
authorJonathan Peyton <jonathan.l.peyton@intel.com>2015-07-09 18:20:51 +0000
committerJonathan Peyton <jonathan.l.peyton@intel.com>2015-07-09 18:20:51 +0000
commit01b58b7d45e613cab942dad0ba95a878deee5ed9 (patch)
tree1149e099c2027f6156af01e1cfe171c86c4c436b /openmp/runtime/src
parent8fbb49ab78ec4192189d42166a79a3e072802232 (diff)
downloadbcm5719-llvm-01b58b7d45e613cab942dad0ba95a878deee5ed9.tar.gz
bcm5719-llvm-01b58b7d45e613cab942dad0ba95a878deee5ed9.zip
Follow up to safe API patch
A while back, we made an initial change where dangerous C API functions were replaced with macros that translated the dangerous API function calls to safer function calls e.g., sprintf() replaced with KMP_SPRINTF() which translates to sprintf_s() on Windows. Currently, the only operating system where this is applicable is Windows. Unix-like systems are still using the dangerous API e.g., KMP_SPRINTF() translates to sprintf(). Our own testing showed no performance differences. Differential Revision: http://reviews.llvm.org/D9918 llvm-svn: 241833
Diffstat (limited to 'openmp/runtime/src')
-rw-r--r--openmp/runtime/src/kmp_barrier.cpp2
-rw-r--r--openmp/runtime/src/kmp_safe_c_api.h4
2 files changed, 2 insertions, 4 deletions
diff --git a/openmp/runtime/src/kmp_barrier.cpp b/openmp/runtime/src/kmp_barrier.cpp
index a2a24f2e98b..e6c4e8adfb9 100644
--- a/openmp/runtime/src/kmp_barrier.cpp
+++ b/openmp/runtime/src/kmp_barrier.cpp
@@ -32,7 +32,7 @@
#else
#define ngo_load(src) ((void)0)
#define ngo_store_icvs(dst, src) copy_icvs((dst), (src))
-#define ngo_store_go(dst, src) memcpy((dst), (src), CACHE_LINE)
+#define ngo_store_go(dst, src) KMP_MEMCPY((dst), (src), CACHE_LINE)
#define ngo_sync() ((void)0)
#endif /* KMP_MIC && USE_NGO_STORES */
diff --git a/openmp/runtime/src/kmp_safe_c_api.h b/openmp/runtime/src/kmp_safe_c_api.h
index fbdca7bac4f..c1df64c6085 100644
--- a/openmp/runtime/src/kmp_safe_c_api.h
+++ b/openmp/runtime/src/kmp_safe_c_api.h
@@ -23,9 +23,7 @@
# define RSIZE_MAX_STR ( 4UL << 10 ) // 4KB
// _malloca was suggested, but it is not a drop-in replacement for _alloca
-// TODO: test performance and replace with _alloca (as below)
-# define KMP_ALLOCA alloca
-//# define KMP_ALLOCA _alloca
+# define KMP_ALLOCA _alloca
# define KMP_MEMCPY_S memcpy_s
# define KMP_SNPRINTF sprintf_s
OpenPOWER on IntegriCloud