Closed yuppox closed 4 years ago
nice. yeah this whole thing needs a complete rework and major version bump some work done over here for an malloc free implementation (WASM safe):
https://github.com/little-core-labs/base64-wasm/blob/master/src/lib.zz
The should drastically reduce the calls to realloc.
Instead of growing by a tiny amount each time, it now increases memory allocation by a fixed amount. In effect, you have fixed-size buffers. Obviously, the functions are not suited to replace malloc/realloc but they should be fine for this specific case.