@@ -156,6 +156,7 @@ pub fn (mut a array) insert(i int, val voidptr) {
156
156
}
157
157
158
158
// insert_many inserts many values into the array from index `i`.
159
+ [unsafe ]
159
160
pub fn (mut a array) insert_many (i int , val voidptr , size int ) {
160
161
$if ! no_bounds_checking ? {
161
162
if i < 0 || i > a.len {
@@ -178,8 +179,9 @@ pub fn (mut a array) prepend(val voidptr) {
178
179
}
179
180
180
181
// prepend_many prepends another array to this array.
182
+ [unsafe ]
181
183
pub fn (mut a array) prepend_many (val voidptr , size int ) {
182
- a.insert_many (0 , val, size)
184
+ unsafe { a.insert_many (0 , val, size) }
183
185
}
184
186
185
187
// delete deletes array element at index `i`.
@@ -420,7 +422,7 @@ fn (mut a array) push(val voidptr) {
420
422
421
423
// push_many implements the functionality for pushing another array.
422
424
// `val` is array.data and user facing usage is `a << [1,2,3]`
423
- // TODO make private, right now it's used by strings.Builder
425
+ [ unsafe ]
424
426
pub fn (mut a3 array) push_many (val voidptr , size int ) {
425
427
if a3 .data == val && ! isnil (a3 .data) {
426
428
// handle `arr << arr`
@@ -632,6 +634,7 @@ pub fn (mut a array) grow_cap(amount int) {
632
634
}
633
635
634
636
// grow_len ensures that an array has a.len + amount of length
637
+ [unsafe ]
635
638
pub fn (mut a array) grow_len (amount int ) {
636
639
a.ensure_cap (a.len + amount)
637
640
a.len + = amount
@@ -728,6 +731,7 @@ pub fn compare_f32(a &f32, b &f32) int {
728
731
729
732
// pointers returns a new array, where each element
730
733
// is the address of the corresponding element in the array.
734
+ [unsafe ]
731
735
pub fn (a array) pointers () []voidptr {
732
736
mut res := []voidptr {}
733
737
for i in 0 .. a.len {
0 commit comments