mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-10 19:21:22 +00:00
parseInt collected every digit into a vector outside the heap count and then copied the digits again for a base-10 parse, and parseFloat copied its whole decimal prefix the same way, so one call on a long string could allocate more than the heap limit. parseInt now counts the digits in place, reads bases other than 10 straight from the string, and both functions reserve heap for the base-10 copy before they make it. A concatenation that the global functions flatten is charged to the heap, as sort keys are.