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

map: make compilable with V2

This commit is contained in:
Alexander Medvednikov 2020-03-19 07:05:20 +01:00
parent bd0548548a
commit 66639924a4

View File

@ -230,8 +230,8 @@ fn (m mut map) meta_greater(ms &u32, i u64, me u32, kvi u32) &u32 {
if (probe_count << 1) == m.extra_metas {
m.extra_metas += extra_metas_inc
mem_size := (m.cap + 2 + m.extra_metas)
metas = &u32(realloc(metas, sizeof(u32) * mem_size))
memset(metas + mem_size - extra_metas_inc, 0, sizeof(u32) * extra_metas_inc)
metas = &u32(C.realloc(metas, sizeof(u32) * mem_size))
C.memset(metas + mem_size - extra_metas_inc, 0, sizeof(u32) * extra_metas_inc)
// Should almost never happen
if probe_count == 252 {
panic("Probe overflow")