diff --git a/source/core.cpp b/source/core.cpp index 88b1140..3e6cc0f 100644 --- a/source/core.cpp +++ b/source/core.cpp @@ -480,7 +480,14 @@ export namespace core { void copy(slice const & target, slice const & origin) { if (target.length < origin.length) core::unreachable(); - for (usize i = 0; i < origin.length; i += 1) target[i] = origin[i]; + for (usize i = 0; i < target.length; i += 1) target[i] = origin[i]; + } + + /** + * Zeroes the contents of `target`. + */ + void zero(slice const & target) { + for (usize i = 0; i < target.length; i += 1) target[i] = 0; } /**