bultin: mark unsafe functions

pull/2460/head
Alexander Medvednikov 2019-10-20 20:29:24 +03:00
parent c13b58e6db
commit 81b1b882fd
2 changed files with 4 additions and 2 deletions

View File

@ -153,6 +153,7 @@ pub fn print(s string) {
__global total_m i64 = 0 __global total_m i64 = 0
//__global nr_mallocs int = 0 //__global nr_mallocs int = 0
[unsafe_fn]
pub fn malloc(n int) byteptr { pub fn malloc(n int) byteptr {
if n < 0 { if n < 0 {
panic('malloc(<0)') panic('malloc(<0)')
@ -185,6 +186,7 @@ pub fn calloc(n int) byteptr {
return C.calloc(n, 1) return C.calloc(n, 1)
} }
[unsafe_fn]
pub fn free(ptr voidptr) { pub fn free(ptr voidptr) {
C.free(ptr) C.free(ptr)
} }

View File

@ -39,5 +39,5 @@ pub fn (b mut Builder) cut(n int) {
} }
pub fn (b mut Builder) free() { pub fn (b mut Builder) free() {
free(b.buf.data) //free(b.buf.data)
} }