Expose way to zero memory in core library
This commit is contained in:
parent
22a8b63d0f
commit
811176ad53
|
@ -480,7 +480,14 @@ export namespace core {
|
||||||
void copy(slice<u8> const & target, slice<u8 const> const & origin) {
|
void copy(slice<u8> const & target, slice<u8 const> const & origin) {
|
||||||
if (target.length < origin.length) core::unreachable();
|
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<u8> const & target) {
|
||||||
|
for (usize i = 0; i < target.length; i += 1) target[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue