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 weak attributions on operator new and delete #487

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Jun 21, 2022

  1. Configuration menu
    Copy the full SHA
    1cf2fd1 View commit details
    Browse the repository at this point in the history
  2. Move operator new weak attributes into cpp file

    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.
    matthijskooijman committed Jun 21, 2022
    Configuration menu
    Copy the full SHA
    c829e46 View commit details
    Browse the repository at this point in the history