commit 4447fdd8ce24e18e1c77ac3ba1683a86fa293c10 parent e54506e432f900cc61b480288d01240c80b1ae7d Author: Drew DeVault <sir@cmpwn.com> Date: Tue, 2 Feb 2021 20:33:40 -0500 rt: add memset Diffstat:
A | rt/memset.ha | | | 6 | ++++++ |
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/rt/memset.ha b/rt/memset.ha @@ -0,0 +1,6 @@ +export fn memset(dest: *void, val: u8, amt: size) void = { + let a = dest: *[*]u8; + for (let i = 0z; i < amt; i += 1z) { + a[i] = val; + }; +};