How the Go runtime implements maps efficiently without generics
The article explains how you can get arbitrarily typed values out of the map using unsafe pointers, but it never really explains how they&#x27;re put in.<p>The insert example in the article uses a function that doesn&#x27;t actually exist in the runtime package, and it implies you can just give it a plain value as input:<p><pre><code>  m[&quot;key&quot;] = 9001   → runtime.mapinsert(m, ”key&quot;, 9001)
</code></pre>
I would assume that is only possible if the 9001 value can make its way through as an actual value on the stack, not as a pointer. Here&#x27;s what I would expect to actually happen:<p><pre><code>  ptr := runtime.mapallocate(m, &quot;key&quot;)  &#x2F;&#x2F; unsafe.Pointer
  *(*int)(ptr) = 9001  &#x2F;&#x2F; Is there a non-typed way to do this?
</code></pre>
While this is a good intro to hash tables in general, the Go specific part feels a little bit lacking.