What does malloc() do in an STM32 MCU run without an OS ?
How does STM32 dynamically allocate memory ?
How does STM32 dynamically allocate memory ?
https://stackoverflow.com/questions/77829982/how-does-arm-none-eabi-gcc-9-2-implement-malloc-free
EDIT
You didn't state what compiler you're asking about.
The above relates to the GCC/ARM compiler, as used in the STM32CubeIDE, using the newlib library.
Other compilers & libraries are available; eg,
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.