aboutsummaryrefslogtreecommitdiff
path: root/core/math/big
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-07-14 11:56:04 +0100
committergingerBill <bill@gingerbill.org>2024-07-14 11:56:04 +0100
commitc7bd9547529a4957e56c7302c5eaca650258ecdc (patch)
treee533ec892b96f3b842ea79351eb7dc2f7e2964f3 /core/math/big
parentedc793d7c123a38826860ef72684308902a7012c (diff)
Add more uses of `#no_capture`
Diffstat (limited to 'core/math/big')
-rw-r--r--core/math/big/helpers.odin10
-rw-r--r--core/math/big/internal.odin8
2 files changed, 9 insertions, 9 deletions
diff --git a/core/math/big/helpers.odin b/core/math/big/helpers.odin
index ee09bb2c7..c82b5eead 100644
--- a/core/math/big/helpers.odin
+++ b/core/math/big/helpers.odin
@@ -404,7 +404,7 @@ clear_if_uninitialized_single :: proc(arg: ^Int, allocator := context.allocator)
return #force_inline internal_clear_if_uninitialized_single(arg, allocator)
}
-clear_if_uninitialized_multi :: proc(args: ..^Int, allocator := context.allocator) -> (err: Error) {
+clear_if_uninitialized_multi :: proc(#no_capture args: ..^Int, allocator := context.allocator) -> (err: Error) {
args := args
assert_if_nil(..args)
@@ -420,7 +420,7 @@ error_if_immutable_single :: proc(arg: ^Int) -> (err: Error) {
return nil
}
-error_if_immutable_multi :: proc(args: ..^Int) -> (err: Error) {
+error_if_immutable_multi :: proc(#no_capture args: ..^Int) -> (err: Error) {
for i in args {
if i != nil && .Immutable in i.flags { return .Assignment_To_Immutable }
}
@@ -431,7 +431,7 @@ error_if_immutable :: proc {error_if_immutable_single, error_if_immutable_multi,
/*
Allocates several `Int`s at once.
*/
-int_init_multi :: proc(integers: ..^Int, allocator := context.allocator) -> (err: Error) {
+int_init_multi :: proc(#no_capture integers: ..^Int, allocator := context.allocator) -> (err: Error) {
assert_if_nil(..integers)
integers := integers
@@ -812,13 +812,13 @@ assert_if_nil :: proc{
assert_if_nil_rat,
}
-assert_if_nil_int :: #force_inline proc(integers: ..^Int, loc := #caller_location) {
+assert_if_nil_int :: #force_inline proc(#no_capture integers: ..^Int, loc := #caller_location) {
for i in integers {
assert(i != nil, "(nil)", loc)
}
}
-assert_if_nil_rat :: #force_inline proc(rationals: ..^Rat, loc := #caller_location) {
+assert_if_nil_rat :: #force_inline proc(#no_capture rationals: ..^Rat, loc := #caller_location) {
for r in rationals {
assert(r != nil, "(nil)", loc)
}
diff --git a/core/math/big/internal.odin b/core/math/big/internal.odin
index c9b331e55..9eaa0c8e1 100644
--- a/core/math/big/internal.odin
+++ b/core/math/big/internal.odin
@@ -1844,7 +1844,7 @@ internal_root_n :: proc { internal_int_root_n, }
Deallocates the backing memory of one or more `Int`s.
Asssumes none of the `integers` to be a `nil`.
*/
-internal_int_destroy :: proc(integers: ..^Int) {
+internal_int_destroy :: proc(#no_capture integers: ..^Int) {
integers := integers
for &a in integers {
@@ -2872,7 +2872,7 @@ internal_clear_if_uninitialized_single :: proc(arg: ^Int, allocator := context.a
return err
}
-internal_clear_if_uninitialized_multi :: proc(args: ..^Int, allocator := context.allocator) -> (err: Error) {
+internal_clear_if_uninitialized_multi :: proc(#no_capture args: ..^Int, allocator := context.allocator) -> (err: Error) {
context.allocator = allocator
for i in args {
@@ -2890,7 +2890,7 @@ internal_error_if_immutable_single :: proc(arg: ^Int) -> (err: Error) {
return nil
}
-internal_error_if_immutable_multi :: proc(args: ..^Int) -> (err: Error) {
+internal_error_if_immutable_multi :: proc(#no_capture args: ..^Int) -> (err: Error) {
for i in args {
if i != nil && .Immutable in i.flags { return .Assignment_To_Immutable }
}
@@ -2901,7 +2901,7 @@ internal_error_if_immutable :: proc {internal_error_if_immutable_single, interna
/*
Allocates several `Int`s at once.
*/
-internal_int_init_multi :: proc(integers: ..^Int, allocator := context.allocator) -> (err: Error) {
+internal_int_init_multi :: proc(#no_capture integers: ..^Int, allocator := context.allocator) -> (err: Error) {
context.allocator = allocator
integers := integers