jwerle / b64.c

Base64 encode/decode
MIT License
269 stars 103 forks source link

Modified to use fixed-size buffers in processing. #23

Closed yuppox closed 4 years ago

yuppox commented 4 years ago

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.

jwerle commented 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