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

builtin,cgen: fix -gc boehm issues with maps; add a CI job for it to prevent regressions (#9453)

This commit is contained in:
Uwe Krüger
2021-03-24 18:49:16 +01:00
committed by GitHub
parent 5b2cec6c6b
commit 522d70b48d
3 changed files with 54 additions and 1 deletions

View File

@@ -108,7 +108,11 @@ mut:
[inline]
fn new_dense_array(key_bytes int, value_bytes int) DenseArray {
slot_bytes := key_bytes + value_bytes
mut slot_bytes := key_bytes + value_bytes
$if gcboehm ? {
align, mask := $if x64 { 7, int(0xfffffff8) } $else { 3, int(0xfffffffc) }
slot_bytes = (slot_bytes + align) & mask
}
cap := 8
return DenseArray{
key_bytes: key_bytes