ref: a7c11c4d0a52661a299a90b47d9a68be8e11312f
dir: /lib/std/memops-impl.myr/
use "types" pkg std = pkglocal const memblit : (dst : byte#, src : byte#, len : std.size -> void) pkglocal const memfill : (dst : byte#, val : byte, len : std.size -> void) ;; const memblit = {dst, src, len var sa, da var s, d da = (dst : intptr) sa = (src : intptr) d = dst[:len] s = src[:len] if da == sa -> void elif da < sa for var i = 0; i < d.len; i++ d[i] = s[i] ;; else for var i = d.len; i > 0; i-- d[i - 1] = s[i - 1] ;; ;; } const memfill = {dst, val, len var d d = dst[:len] for var i = 0; i < d.len; i++ d[i] = val ;; }