Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Use custom version of atoi() to eliminate dependency on newlib's locale and save RAM #323
As discussed over at the MicroPython port to the micro:bit bbcmicrobit/micropython#363, the latest version of newlib (2.5.0) introduced some new locale handling code and has a large (~350 bytes)
Upstream at newlib they say that the only way around this is to add an option to newlib to completely disable the locale stuff, see https://sourceware.org/ml/newlib/2017/msg01041.html
Since that option might not be feasible for us (it requires a custom newlib build) I found another way: the only place in the DAL that uses the locale-dependent code (at least in the MicroPython port) is in
Is this a modification (changing atoi to my_atoi) that would be accepted in the DAL?
Yes, of course. No problem at all - a natural home would be here:
Do you have a simple implementation to hand? If not, I have a few hundred minions learning C at the moment that could sharpen their teeth on this... They'll do anything for a mars bar.