-
Notifications
You must be signed in to change notification settings - Fork 74
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
Pass USB_OTG_CfgTypeDef by reference. #16
Pass USB_OTG_CfgTypeDef by reference. #16
Conversation
Thanks, this looks like a good optimisation. It might make it harder to update to newer HAL versions, but I guess we can deal with that when needed. Would it be better to pass it in as a |
Yes, that sounds like a good idea. |
USB_OTG_CfgTypeDef is a large struct, so passing by reference should be more efficient in terms of stack usage and code size. Signed-off-by: David Lechner <[email protected]>
USB_OTG_CfgTypeDef is a large struct, so passing by reference should be more efficient in terms of stack usage and code size. Signed-off-by: David Lechner <[email protected]>
USB_OTG_CfgTypeDef is a large struct, so passing by reference should be more efficient in terms of stack usage and code size. Signed-off-by: David Lechner <[email protected]>
USB_OTG_CfgTypeDef is a large struct, so passing by reference should be more efficient in terms of stack usage and code size. Signed-off-by: David Lechner <[email protected]>
USB_OTG_CfgTypeDef is a large struct, so passing by reference should be more efficient in terms of stack usage and code size. Signed-off-by: David Lechner <[email protected]>
USB_OTG_CfgTypeDef is a large struct, so passing by reference should be more efficient in terms of stack usage and code size. Signed-off-by: David Lechner <[email protected]>
USB_OTG_CfgTypeDef is a large struct, so passing by reference should be more efficient in terms of stack usage and code size. Signed-off-by: David Lechner <[email protected]>
913a8d5
to
d0aa2f3
Compare
I have updated with the suggested change. |
This updates all HAL libraries to pass USB_OTG_CfgTypeDef by reference. USB_OTG_CfgTypeDef is a large struct that is being passed by value which uses extra stack and bigger code due to the extra copy of the struct.