Changeset 34120f10 in mainline for common/stdc/mem.c
- Timestamp:
- 2023-10-27T19:38:31Z (7 months ago)
- Branches:
- master, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 63ed840
- Parents:
- c89ae25 (diff), 694ca3d6 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
common/stdc/mem.c
rc89ae25 r34120f10 34 34 */ 35 35 36 #include <mem.h> 36 #include "../include/mem.h" 37 37 38 #include <stdlib.h> 38 39 #include <stddef.h> 39 40 #include <stdint.h> 40 #include "private/cc.h" 41 #include "cc.h" 42 43 #undef memset 44 #undef memcpy 45 #undef memcmp 46 #undef memmove 47 #undef memchr 41 48 42 49 /** Fill memory block with a constant value. */ 50 DO_NOT_DISCARD 43 51 ATTRIBUTE_OPTIMIZE_NO_TLDP 44 52 void *memset(void *dest, int b, size_t n) … … 99 107 } __attribute__((packed)); 100 108 101 static void *unaligned_memcpy(void *dst, const void *src, size_t n) 109 ATTRIBUTE_OPTIMIZE_NO_TLDP 110 static void *unaligned_memcpy(void *dst, const void *src, size_t n) 102 111 { 103 112 size_t i, j; … … 116 125 117 126 /** Copy memory block. */ 127 DO_NOT_DISCARD 118 128 ATTRIBUTE_OPTIMIZE_NO_TLDP 119 129 void *memcpy(void *dst, const void *src, size_t n) … … 194 204 195 205 /** Move memory block with possible overlapping. */ 206 DO_NOT_DISCARD 207 ATTRIBUTE_OPTIMIZE_NO_TLDP 196 208 void *memmove(void *dst, const void *src, size_t n) 197 209 { … … 239 251 * 240 252 */ 241 int memcmp(const void *s1, const void *s2, size_t len) 253 DO_NOT_DISCARD 254 ATTRIBUTE_OPTIMIZE_NO_TLDP 255 int memcmp(const void *s1, const void *s2, size_t len) 242 256 { 243 257 uint8_t *u1 = (uint8_t *) s1; … … 264 278 * bytes of @a s or @c NULL if not found. 265 279 */ 280 DO_NOT_DISCARD 281 ATTRIBUTE_OPTIMIZE_NO_TLDP 266 282 void *memchr(const void *s, int c, size_t n) 267 283 {
Note:
See TracChangeset
for help on using the changeset viewer.