mem.eql (stdlib)

This commit is contained in:
2026-07-12 21:02:12 +02:00
parent c914083102
commit 0a424ec6d2
5 changed files with 51 additions and 2 deletions
+14
View File
@@ -27,6 +27,20 @@ raw_free func(allocator Allocator, memory ?*mut u8, size usize, alignment usize)
allocator.vtable.free(allocator.context, memory, size, alignment)
}
eql func($T type, left, right []T) bool {
if left.len != right.len {
return false
}
i usize = 0
while i < left.len : i += 1 {
if left[i] != right[i] {
return false
}
}
return true
}
_empty_storage [1]mut u64 = [0]
_empty_slice func($T type, count usize) []mut T {