aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkUtils.h
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2017-01-04 14:44:20 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-01-24 18:01:16 +0000
commit57bc1e7bc804be4779dd09409046f62c4d43e3cd (patch)
tree039d2d3f2b9eb57d3ba2f9d4f68d0f25585335e6 /src/core/SkUtils.h
parentaee504beb2185e7297b30c02a1541d1306196416 (diff)
move sk_memset16,32,64 out-of-line
This helps pick it out on profiles and when debugging. This will have a negligible impact on speed in most cases (small memsets are always fast, large memsets dwarf function call overhead), and clients like Chrome that use link-time optimization should see exactly zero impact. This does however affect code size: it makes libskia 43K smaller on my laptop. Change-Id: I55bdc75b7429a63024ab3b7d55dc1f886bde102a Reviewed-on: https://skia-review.googlesource.com/6589 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Herb Derby <herb@google.com>
Diffstat (limited to 'src/core/SkUtils.h')
-rw-r--r--src/core/SkUtils.h34
1 files changed, 5 insertions, 29 deletions
diff --git a/src/core/SkUtils.h b/src/core/SkUtils.h
index e24dd52f45..241a61ad2f 100644
--- a/src/core/SkUtils.h
+++ b/src/core/SkUtils.h
@@ -11,38 +11,14 @@
#include "SkTypes.h"
#include "SkMath.h"
-/** Similar to memset(), but it assigns a 16bit value into the buffer.
+/** Similar to memset(), but it assigns a 16, 32, or 64-bit value into the buffer.
@param buffer The memory to have value copied into it
- @param value The 16bit value to be copied into buffer
+ @param value The value to be copied into buffer
@param count The number of times value should be copied into the buffer.
*/
-static inline void sk_memset16(uint16_t buffer[], uint16_t value, int count) {
- for (int i = 0; i < count; i++) {
- buffer[i] = value;
- }
-}
-
-/** Similar to memset(), but it assigns a 32bit value into the buffer.
- @param buffer The memory to have value copied into it
- @param value The 32bit value to be copied into buffer
- @param count The number of times value should be copied into the buffer.
-*/
-static inline void sk_memset32(uint32_t buffer[], uint32_t value, int count) {
- for (int i = 0; i < count; i++) {
- buffer[i] = value;
- }
-}
-
-/** Similar to memset(), but it assigns a 64bit value into the buffer.
- @param buffer The memory to have value copied into it
- @param value The 64bit value to be copied into buffer
- @param count The number of times value should be copied into the buffer.
-*/
-static inline void sk_memset64(uint64_t buffer[], uint64_t value, int count) {
- for (int i = 0; i < count; i++) {
- buffer[i] = value;
- }
-}
+void sk_memset16(uint16_t buffer[], uint16_t value, int count);
+void sk_memset32(uint32_t buffer[], uint32_t value, int count);
+void sk_memset64(uint64_t buffer[], uint64_t value, int count);
///////////////////////////////////////////////////////////////////////////////
#define kMaxBytesInUTF8Sequence 4