Open d21d3q opened 7 years ago
@d21d3q looks good!
So you don't mind breaking backward compatibility? On the other hand incrementing major version number will do the job.
@d21d3q in this case, no I do not. The less malloc calls this implementation can make, the better
How about making this library able to use static buffers? I am playing with them now on this branch. For now I've added
b64_encode_static
because it has different parameters set, but ideally would be to make one entry point with optional (nullable) parameter for output buffer, sob64_encode
would look like this. Another thing would be introduce some macro (egB64_STATIC_BUFFERS_ONLY
) which would exclude code for dynamic memory allocation. Have a look at nanopb library. Quite big, but in can run both with dynamic memory allocation and without (excluded at compilation time).Motivation for this is performance improvement - I am currently making project which is translating some serial protocol into another (with human readable frames) so that calling malloc and free for every single incoming byte seems to be overhead for this task.