Skip to content

Conversation

trowbridgec
Copy link

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
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.

3 participants