One rule over every allocating operation, so it has to hold for map-new, put, reserve and clone exactly as it holds for vec-new, push, reserve and clone. put stays Unit and clone stays the container; nothing grows a Result. A map is the harder of the two and that is why it gets its own program. A Vec's failing allocation leaves the Vec untouched, whereas a map's growth allocates a whole new block, rehashes into it and only then releases the old one — so a failure partway has to leave the map exactly as it was or the retry re-attempts against a half-moved map. 300 entries through several grows against a ceiling that is raised each time, then every one of them read back: no entry lost, none doubled.
Description
Languages
OCaml
67.2%
Emacs Lisp
15.2%
C
10.4%
HTML
2.9%
Standard ML
2.8%
Other
1.5%