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

GC-boehm: extend optimized mode to all array methods (#10406)

This commit is contained in:
Uwe Krüger
2021-06-10 20:26:17 +02:00
committed by GitHub
parent 9a9d539e6f
commit 0e2c86310a
9 changed files with 210 additions and 22 deletions

View File

@ -408,6 +408,17 @@ pub fn memdup(src voidptr, sz int) voidptr {
}
}
[unsafe]
pub fn memdup_noscan(src voidptr, sz int) voidptr {
if sz == 0 {
return vcalloc_noscan(1)
}
unsafe {
mem := vcalloc_noscan(sz)
return C.memcpy(mem, src, sz)
}
}
[inline]
fn v_fixed_index(i int, len int) int {
$if !no_bounds_checking ? {