map: make compilable with V2

pull/4072/head
Alexander Medvednikov 2020-03-19 07:05:20 +01:00
parent bd0548548a
commit 66639924a4
1 changed files with 24 additions and 24 deletions

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")