summaryrefslogtreecommitdiff
path: root/lib/std/clear.myr
diff options
context:
space:
mode:
Diffstat (limited to 'lib/std/clear.myr')
-rw-r--r--lib/std/clear.myr12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/std/clear.myr b/lib/std/clear.myr
new file mode 100644
index 0000000..c16c851
--- /dev/null
+++ b/lib/std/clear.myr
@@ -0,0 +1,12 @@
+use "slfill.use"
+pkg std =
+ generic clear : (p : @a# -> void)
+;;
+
+generic clear = {p : @a#
+ var bp
+
+ bp = p castto(byte#)
+ slfill(bp[:sizeof(@a)], 0)
+}
+