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 missing overrides for global operator new #743

Merged

Conversation

A-Dunstan
Copy link
Contributor

Updating the toolchain to support C++17 added some new overloads for operators new and delete to support overly-aligned allocations. Overrides for these are missing from Teensyduino which results in the newlib defaults being used (which link in a bunch of exception throwing/handling stuff that we don't want).

(The delete overrides aren't all that important, they're just there to ensure any memory allocated with our new operators is deallocated using the appropriate method i.e. via free() ).

@PaulStoffregen
Copy link
Owner

I'm concerned about changing the includes. Is that really necessary?

@PaulStoffregen PaulStoffregen merged commit 4b5097a into PaulStoffregen:master Sep 8, 2024
@A-Dunstan
Copy link
Contributor Author

For the stdlib inclusion, .cpp files should use the c++ include files.
Iirc adding #include <new> was necessary to get the std::align_val_t definition.

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