bultin: mark unsafe functions
parent
c13b58e6db
commit
81b1b882fd
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue