Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pvPortRealloc Implementation in AVR32_UC3 Port #1012

Open
liamHowatt opened this issue Mar 10, 2024 · 1 comment
Open

pvPortRealloc Implementation in AVR32_UC3 Port #1012

liamHowatt opened this issue Mar 10, 2024 · 1 comment

Comments

@liamHowatt
Copy link

void * pvPortRealloc( void * pv,

void * pvPortRealloc( void * pv,

These ports were added 17 years ago in this commit 504382b and are the only ones that implement pvPortRealloc. It's implemented here by calling stdlib realloc. I wanted to verify whether this is correct? I think this would only work as expected for heap_3 (it wraps and calls the stdlib malloc and free). For other heaps I think there would be issues since realloc would create a pointer that gets passed to heap_'s vPortFree, which it wouldn't know how to free.

Maybe a good legacy-friendly fix would be to statically assert that heap_3 is being used for the AVR32_UC3 port?

@AniruddhaKanhere
Copy link
Member

Hello @liamHowatt,

Your analysis seems correct. This will not work with the heaps managed by FreeRTOS itself. And thus would only work with the heap_3 implementation using the stdlib.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants