| ... | ... | @@ -9,26 +9,17 @@ const builtin = @import("builtin"); |
| 9 | 9 | export fn memset(dest: ?&u8, c: u8, n: usize) { |
| 10 | 10 | @setDebugSafety(this, false); |
| 11 | 11 | |
| 12 | | if (n == 0) |
| 13 | | return; |
| 14 | | |
| 15 | | const d = ??dest; |
| 16 | 12 | var index: usize = 0; |
| 17 | 13 | while (index != n; index += 1) |
| 18 | | d[index] = c; |
| 14 | (??dest)[index] = c; |
| 19 | 15 | } |
| 20 | 16 | |
| 21 | 17 | export fn memcpy(noalias dest: ?&u8, noalias src: ?&const u8, n: usize) { |
| 22 | 18 | @setDebugSafety(this, false); |
| 23 | 19 | |
| 24 | | if (n == 0) |
| 25 | | return; |
| 26 | | |
| 27 | | const d = ??dest; |
| 28 | | const s = ??src; |
| 29 | 20 | var index: usize = 0; |
| 30 | 21 | while (index != n; index += 1) |
| 31 | | d[index] = s[index]; |
| 22 | (??dest)[index] = (??src)[index]; |
| 32 | 23 | } |
| 33 | 24 | |
| 34 | 25 | export fn __stack_chk_fail() { |