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

Fix for supporting C++14 sized deallocation operator #3

Merged
merged 1 commit into from
Apr 21, 2020

Conversation

antisvin
Copy link
Collaborator

It's a minor issue, but I felt like doing something with low practical value today.

This fixes error that was happening when building under C++14. I didn't change Makefiles themselves to use it, just confirmed that defining operator makes it work. It looks like building in C++14 mode made no changes to firmware code size, so GCC is likely generating the same code unless some newer language features are used.

Info about this in C++ standard is here: https://isocpp.org/files/papers/n3778.html

Size parameter is just a hint that allows writing more effective deallocation handlers, but it's often ignored. Since Freertos deallocator doesn't support such parameter, we can also ignore it (this seems to also be the case if using GCC stdlib)

I've added sized delete[] operator as well for completeness, but it doesn't seem to be required in our code yet.

@pingdynasty pingdynasty changed the base branch from master to develop April 21, 2020 01:41
@pingdynasty pingdynasty merged commit 1d7abbb into RebelTechnology:develop Apr 21, 2020
@pingdynasty
Copy link
Collaborator

Okay! Merged into develop. Are there any specific C++14 features you think we should use?

@antisvin
Copy link
Collaborator Author

First of all, there's not so much new features in C++14 - I can only think of variable templates and binary literals as useful new features.

But it also does fix lots of flaws/restrictions in C++11 and this standard has plenty of good stuff. Many of those features could be used more often here - I would say at least constexpr, uniform initialization and operator deleting are particularly important.

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

Successfully merging this pull request may close these issues.

2 participants