adafruit / Adafruit_nRF52_Arduino

Adafruit code for the Nordic nRF52 BLE SoC on Arduino
Other
601 stars 489 forks source link

Implemented thread-safe realloc and calloc #744

Closed godario closed 7 months ago

godario commented 1 year ago

Hello everybody. I have noticed that your FreeRTOS implementation only provides the threadsafe version of malloc and free while realloc and calloc are still not threadsafe. In case of very intense use of objects like String (which uses realloc) or in general of realloc/calloc, I noticed some hangs that I solved by implementing pvPortRealloc and pvPortCalloc and then wrapping the real realloc and calloc from the linker. Hope it can help!