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

Add mbed support for malloc() and free() #92

Conversation

trowbridgec
Copy link
Contributor

This PR adds Mbed support for erpc_malloc() and erpc_free().

@AGlass0fMilk

@MichalPrincNXP
Copy link
Member

Hello @trowbridgec , in case standard malloc() and free() functions are used the erpc_port_stdlib.cpp can be utilized. I do not think it is neccessary to introduce this file, unless there are any mbedOS-specific allocator functions to be used.

@trowbridgec
Copy link
Contributor Author

Hi @MichalPrincNXP,

As it turns out, since the erpc_port_stdlib.cpp file also provides definitions for the new and delete operators, when I use that file with Mbed, I get linker errors complaining of multiple definitions for new and delete since Mbed's sources already define them.

From what I can tell, it looks like Mbed support really just requires defining the erpc_malloc() and erpc_free() functions. What's the best way to handle that: a separate Mbed-specific porting file? adding a #if to erpc_port_stdlib.cpp to check what platform is being used?

Thanks!

@MichalPrincNXP
Copy link
Member

Hi @trowbridgec , thanks, then I am OK with having this mbed-specific file and would accept this PR. @AGlass0fMilk could you please review and confirm adding this source that will be of your interest?

@MichalPrincNXP MichalPrincNXP self-assigned this Jul 14, 2020
@MichalPrincNXP
Copy link
Member

@AGlass0fMilk , could you please review and confirm adding this source that will be of your interest? Thank you. M.

@MichalPrincNXP
Copy link
Member

@AGlass0fMilk , did you have a chance to make the review of this PR? Please let us know. Thanks.

@AGlass0fMilk
Copy link
Contributor

LGTM, I have no problem with introducing this.

@MichalPrincNXP MichalPrincNXP merged commit f791e0b into EmbeddedRPC:develop Sep 9, 2020
@MichalPrincNXP
Copy link
Member

Thank you @trowbridgec
Michal

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

Successfully merging this pull request may close these issues.

None yet

3 participants