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

checker: check unsafe V function calls (#8752)

This commit is contained in:
Nick Treleaven
2021-02-14 18:31:42 +00:00
committed by GitHub
parent d3bcd5d305
commit ea803113c3
36 changed files with 200 additions and 161 deletions

View File

@ -341,7 +341,7 @@ fn my_init(mut app App) {
w := 256
h := 256
sz := w * h * 4
tmp_txt := malloc(sz)
tmp_txt := unsafe {malloc(sz)}
mut i := 0
for i < sz {
unsafe {
@ -370,8 +370,10 @@ fn my_init(mut app App) {
i += 4
}
}
app.texture = create_texture(w, h, tmp_txt)
free(tmp_txt)
unsafe {
app.texture = create_texture(w, h, tmp_txt)
free(tmp_txt)
}
}
fn cleanup(mut app App) {