Commit 9f227ee1 authored by Alastair Robertson's avatar Alastair Robertson

Maps without keys should be given a 64-bit integer key of 0

Previously the auto-generated key type was the same as the value type,
which made maps containing string values use far more stack memory than
they should when accessing them.
parent e222131c
......@@ -400,7 +400,7 @@ AllocaInst *CodegenLLVM::getMapKey(Map &map)
}
else
{
key = b_.CreateAllocaBPF(map.type, map.ident + "_key");
key = b_.CreateAllocaBPF(SizedType(Type::integer, 8), map.ident + "_key");
b_.CreateStore(b_.getInt64(0), key);
}
return key;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment