- Mar 01, 2018
-
-
Reini Urban authored
skip CONSTP(dmax) CONSTP(slen) as they prohibit constant folding of this expr. TODO: always_inline helps in arg propagation (-O3), but needs to be probed for.
-
Reini Urban authored
no _real, static inline _unchecked worker, and 2 exported funcs: _s (already checked) and _s_chk (some unchecked, deferred to run-time checks) See #48
-
Reini Urban authored
skip run-time checks when already checked at compile-time. split functions into two: unchecked and checked, depending on the already done compile-time check. currently only useful for clang-5+ gcc cannot not handle BOS as compile-time constant, how lame. shaves off 10% p_memcpy_s, when all 4 args are of known size + constant len. See #48
-
Reini Urban authored
Probe for static_assert in CXX11 or C11 If args are compile-time constants and satisfy a constant expr, call the func, otherwise produce a compile-time error. But static_assert cannot be used inside args, only as statement. See #48
-
- Feb 28, 2018
-
-
Reini Urban authored
to avoid downloading it
-
Reini Urban authored
-
Reini Urban authored
-
Reini Urban authored
from config.h They are needed by the library users in safe_compile.h for compile-time checks. HAVE___BUILTIN_CONSTANT_P, HAVE_WARN_DMAX, HAVE_ERROR_DMAX
-
- Feb 27, 2018
-
-
Reini Urban authored
overflow checks are not reliable on linux yet
-
Reini Urban authored
-
Reini Urban authored
-
Reini Urban authored
only detected with clang-5 -O2, which doesnt clear the static str1 and reuses the word after. not even valgrind detected that overflow. add to smoke.sh
-
Reini Urban authored
-
Reini Urban authored
-
Reini Urban authored
similar to memcpy_s, just that gcc is doing ok here.
-
Reini Urban authored
use 64bit copy on 64bit machines, not just 32bit. memcpy_s is now as fast as memcpy native, with in overhead of -1 to +3%, on clang-4+ gcc is only 77% slower, not 89%.
-
Reini Urban authored
esp. memcpy_s is significantly faster with clang-7 on darwin. Only 50-55% slowdown, not 90%. And with clang-4+ -march=native the overhead is only 5-20%.
-
Reini Urban authored
-
- Feb 26, 2018
-
-
Reini Urban authored
-
Reini Urban authored
-
Reini Urban authored
there is no measurable --disable-constraint-handler speedup, but a huge _s slowdown of ~90%. The size overhead for the constraint-handler is 35%-100%. Use proper timings, asm rdtsc
-
Reini Urban authored
undef the run-time invoke_safe_{str,mem}_constraint_handler function calls in safe_config.h to avoid the large errormsg strings. As in freebsd. Most of the OS/libc folks complain about it, but it is useful, similar to the malloc hooks. They are only used in the error cases. Closes #50 -
Reini Urban authored
destbos is -1 then. no clearing in this case. only detected on glibc/gcc-7 with -Werror=stringop-overflow specified size 18446744073709551612 exceeds maximum object size 9223372036854775807
-
Reini Urban authored
-
Reini Urban authored
Closes #40. Todo: Now the msvcrt checks can be switched back to compile-time, and #ifdef's.
-
Reini Urban authored
-
Reini Urban authored
-
Reini Urban authored
-
Reini Urban authored
and clear dest on EOVERFLOW and ESNOSPC
-
Reini Urban authored
Cast pointers to be compared to (uintptr_t) as in mem_prim_move "Comparing pointers from two separately allocated objects is forbidden as per 6.5.8 C11 except when using (in)equality." See also intel/safestringlib#18 Closes GH #51
-
Reini Urban authored
needs to be supressed. bsd allocates a fresh struct tm in a helper thread for _r, which needs to be supressed. it is with glibc.
-
Reini Urban authored
without tests yet
-
Reini Urban authored
-
Reini Urban authored
dont apply the early slen check optimization from strstr yet
-
Reini Urban authored
and pass the ptr arg to the constraint handler
-
Reini Urban authored
-
Reini Urban authored
to link to the native functions, not _chk
-
Reini Urban authored
convert to _chk, check for dest overflows. remove errno, return negative error codes, as with s{n}printf_s. -
Reini Urban authored
ESUNTERM for src to avoid overflows.
-
- Feb 25, 2018
-
-
Reini Urban authored
overload checks with const literal strings fail on travis with clang-5.0 on linux
-