Add @(rodata) and @(static, rodata) where appropriate

This commit is contained in:
gingerBill
2024-06-06 15:23:52 +01:00
parent bea47db495
commit 3a9b86628a
13 changed files with 43 additions and 32 deletions
+1 -1
View File
@@ -375,7 +375,7 @@ decimal_to_float_bits :: proc(d: ^decimal.Decimal, info: ^Float_Info) -> (b: u64
return
}
@static power_table := [?]int{1, 3, 6, 9, 13, 16, 19, 23, 26}
@(static, rodata) power_table := [?]int{1, 3, 6, 9, 13, 16, 19, 23, 26}
exp = 0
for d.decimal_point > 0 {
+1 -1
View File
@@ -1095,7 +1095,7 @@ parse_f64_prefix :: proc(str: string) -> (value: f64, nr: int, ok: bool) {
}
trunc_block: if !trunc {
@static pow10 := [?]f64{
@(static, rodata) pow10 := [?]f64{
1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9,
1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19,
1e20, 1e21, 1e22,