musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
summary refs log tree commit diff
path: root/src/string/memset.c
AgeCommit message (Collapse)AuthorLines
2017年08月29日fix undefined behavior in memset due to missing sequence points Rich Felker-4/+8
patch by Pascal Cuoq.
2013年08月27日optimized C memset Rich Felker-12/+77
this version of memset is optimized both for small and large values of n, and makes no misaligned writes, so it is usable (and near-optimal) on all archs. it is capable of filling up to 52 or 56 bytes without entering a loop and with at most 7 branches, all of which can be fully predicted if memset is called multiple times with the same size. it also uses the attribute extension to inform the compiler that it is violating the aliasing rules, unlike the previous code which simply assumed it was safe to violate the aliasing rules since translation unit boundaries hide the violations from the compiler. for non-GNUC compilers, 100% portable fallback code in the form of a naive loop is provided. I intend to eventually apply this approach to all of the string/memory functions which are doing word-at-a-time accesses.
2011年02月12日initial check-in, version 0.5.0 v0.5.0 Rich Felker-0/+21
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月09日 14:04:55 +0000

AltStyle によって変換されたページ (->オリジナル) /