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
This commit is contained in:
Jonathan Peyton 2015-07-09 18:20:51 +00:00
parent 8fbb49ab78
commit 01b58b7d45
2 changed files with 2 additions and 4 deletions

View File

@ -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 */

View File

@ -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