Minimize mem.zero use

This commit is contained in:
gingerBill
2019-02-06 13:33:31 +00:00
parent fa5d00521b
commit a194aa5a9e
4 changed files with 41 additions and 42 deletions
-4
View File
@@ -71,10 +71,6 @@ compare :: inline proc "contextless" (a, b: []byte) -> int {
return compare_byte_ptrs(&a[0], &b[0], min(len(a), len(b)));
}
compare_byte_ptrs :: proc "contextless" (a, b: ^byte, n: int) -> int #no_bounds_check {
ptr_idx :: proc(ptr: $P/^$T, n: int) -> T {
return ptr_offset(ptr, n)^;
}
x := slice_ptr(a, n);
y := slice_ptr(b, n);
-1
View File
@@ -6,7 +6,6 @@ Proc_Tag :: enum {
Bounds_Check,
No_Bounds_Check,
Require_Results,
No_Context,
}
Proc_Tags :: distinct bit_set[Proc_Tag; u32];
+1 -1
View File
@@ -28,7 +28,7 @@ pos_compare :: proc(lhs, rhs: Pos) -> int {
return strings.compare(lhs.file, rhs.file);
}
using Kind :: enum i32 {
using Kind :: enum u16 {
Invalid,
EOF,
Comment,