6 ms·
Any software written for microcontrollers or other low-memory environments is probably not going to use mmap or, more generally, anything that dynamically manip
by comex 4y ago
Any software written for microcontrollers or other low-memory environments is probably not going to use mmap or, more generally, anything that dynamically manipulates memory mappings (if there even is an MMU in the first place).
That said, the specific use of a function called sbrk seems odd and maybe archaic, since it has no useful role if the heap is fixed-sized anyway. But it looks like newlib (the libc being used here) uses _sbrk as part of an abstraction that supports many different environments [1], including not just bare metal but also running as a userland program under Linux and other kernels. So maybe it makes sense.
[1] https://github.com/eblot/newlib/search?q=_sbrk&type=code https://github.com/eblot/newlib/search?q=_sbrk&type=code