Post A5wTvNe3v94mUTPawS by piggo@piggo.space
(DIR) More posts by piggo@piggo.space
(DIR) Post #A5wPwPctdm1N6l6SHo by piggo@piggo.space
2021-04-05T16:08:46.959053Z
0 likes, 0 repeats
well that was kind of fun. the firmware i'm wokring on is now successfully de-malloced. Did you know rand() uses malloc internally? it makes no fucking sense
(DIR) Post #A5wQWWzJkPKYMfoTaK by piggo@piggo.space
2021-04-05T16:15:18.699425Z
1 likes, 0 repeats
getting rid of newlib s*printf and malloc let me go from close to 100 kB to 30 and also drastically reduce RAM usage. without any change in functionality. seriously, how is the library so bloated
(DIR) Post #A5wRJdCLRmRVoZJrVI by hopeless@mas.to
2021-04-05T16:22:43Z
0 likes, 0 repeats
@piggo malloc and vsnprintf are really complicated if they offer all the modern features.Do you know about -ffunction-sections ?
(DIR) Post #A5wRJdZ25Qagwvvyro by piggo@piggo.space
2021-04-05T16:24:10.308250Z
0 likes, 0 repeats
@hopeless of course, it would be many times bigger without -Wl,--gc-sections -ffunction-sections -fdata-sections. I now have a replacement printf that has all the normally used features (even float) but is so much smaller
(DIR) Post #A5wS7H7pmrjDpusio4 by lanodan@queer.hacktivis.me
2021-04-05T16:33:09.547953Z
0 likes, 0 repeats
@piggo I think musl tries to avoid malloc, which is why I tend to target it for reliability and space-constraint stuff.
(DIR) Post #A5wTvNe3v94mUTPawS by piggo@piggo.space
2021-04-05T16:53:25.033867Z
0 likes, 0 repeats
@lanodan do you know if musl works for cortex-m? I can§t seem to find any clear confirmation, just some ancient mailing list threads
(DIR) Post #A5wUtIrepAL52RLPP6 by lanodan@queer.hacktivis.me
2021-04-05T17:04:14.889907Z
0 likes, 0 repeats
@piggo Good question, but I think it should work.