big: More ZII refactoring.

This commit is contained in:
Jeroen van Rijn
2021-08-11 20:59:50 +02:00
parent 687c211a58
commit 2e372b33a3
6 changed files with 151 additions and 182 deletions
+6 -1
View File
@@ -12,9 +12,14 @@ package big
*/
import "core:intrinsics"
import "core:mem"
int_is_initialized :: proc(a: ^Int) -> bool {
return a != rawptr(uintptr(0)) && a.allocated >= _MIN_DIGIT_COUNT;
if a == nil {
return false;
}
raw := transmute(mem.Raw_Dynamic_Array)a.digit;
return raw.cap >= _MIN_DIGIT_COUNT;
}
int_is_zero :: proc(a: ^Int) -> bool {