Toolchains may provide a set of utilities, which often include dynamic memory allocation mechanisms. GCC-based toolchains for microcontrollers include a reduced set of standard C calls, usually in the built-in standard C library. A popular choice, often included in the ARM-GCC embedded toolchain, is newlib. While providing the implementation of many standard calls, newlib remains as flexible as possible, by allowing customization of the operations involving the hardware. The newlib library can be integrated in both single-thread bare-metal applications and in a real-time operating system, provided that the required system calls are implemented.
In the case of malloc, newlib requires an existing implementation of the sbrk function. ...