-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 weak attributions on operator new and delete #487
Open
matthijskooijman
wants to merge
2
commits into
arduino:master
Choose a base branch
from
matthijskooijman:fix-new-delete-weak
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Fix weak attributions on operator new and delete #487
matthijskooijman
wants to merge
2
commits into
arduino:master
from
matthijskooijman:fix-new-delete-weak
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
These were introduced in commit 4e469e0 (Allow overriding selected operator new and delete functions) with the intention to make the Arduino-provided definitions weak and allow them to be replaced by sketch-provided or library-provided versions. However, the attributes were placed in the `<new>` header file, causing *all* implementations (that `#include <new>`) to become weak (including sketch or library versions), which is not the intention. This commit fixes this by moving the weak attributes into the cpp file, causing only the Arduino-provided implementations to become weak. Note that in practice, the linking order (or maybe the use of an archive file for linking the core) seems to ensure that the sketch-provided versions are preferred over the the Arduino-provided versions, so even without this commit these operators can be replaced by the sketch.
Memory usage change @ c829e46
Click for full report table
Click for full report CSV
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When I introduced the weak attributes for various operator new and delete functions in #361, I accidentally put them in the header file instead of the source file. Fixing this is fairly trivial. See #361 (comment) and the commit message for details.
I based this PR on top of (a rebased version of) #456, since that PR touches a lot of the same lines (though is logically unrelated). We can either just merge this PR along with that commit, or merge that one first and I can rebase this one to drop the duplicate commit.