Page size allocation for malloc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-09-27 1:35 AM
In the STM32CubeIDE predecessor (Atollic IDE) it was possible to set the page size allocation for malloc.
Is this somehow also possible in the STM32CubeIDE?
Is my understanding correct, that this page size will be reserved from the RAM by the sbrk() function. Then the malloc gets the needed size from this buffer. As soon as there is no longer enough space, the sbrk() functions gets another block?
Kind regards
Mathias
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-09-27 5:34 AM
In the C library that goes with CubeIDE you don't need it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-09-27 7:11 AM
Thanks for the reply.
But can I change it from 4096 bytes (default) to e.g. 128 bytes?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-09-27 7:41 AM - edited ‎2024-09-27 2:45 PM
Yes you can. But you don't need to, with the current version of newlib shipped with CubeIDE.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-10-01 1:19 AM
But if I would like to do it, how can I configure it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-10-01 3:25 AM
By modification of _sbrk (sysmem.c in your project) or by modification of malloc in newlib and rebuilding the newlib.
