1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

parser: error on [unsafe_fn] (#6090)

This commit is contained in:
Nick Treleaven
2020-08-09 10:22:11 +01:00
committed by GitHub
parent 200f8dacb7
commit 2dd90de993
12 changed files with 30 additions and 28 deletions

View File

@ -219,7 +219,7 @@ pub fn (mut a array) trim(index int) {
}
// we manually inline this for single operations for performance without -prod
[inline] [unsafe_fn]
[inline] [unsafe]
fn (a array) get_unsafe(i int) voidptr {
unsafe {
return byteptr(a.data) + i * a.element_size
@ -379,7 +379,7 @@ fn (a &array) slice_clone(start, _end int) array {
}
// we manually inline this for single operations for performance without -prod
[inline] [unsafe_fn]
[inline] [unsafe]
fn (mut a array) set_unsafe(i int, val voidptr) {
unsafe {
C.memcpy(byteptr(a.data) + a.element_size * i, val, a.element_size)
@ -462,7 +462,7 @@ pub fn (a array) reverse() array {
}
// pub fn (a []int) free() {
[unsafe_fn]
[unsafe]
pub fn (a &array) free() {
$if prealloc {
return