Skip to content

Use casts in _Atomic_reinterpret_as for integral and pointer types. - #227

Merged
Billy O'Neal (BillyONeal) merged 1 commit into
microsoft:masterfrom
BillyONeal:static_cast_atomic
Oct 28, 2019
Merged

Billy O'Neal (BillyONeal) merged 1 commit into
microsoft:masterfrom
BillyONeal:static_cast_atomic

Conversation

@BillyONeal

@BillyONeal Billy O'Neal (BillyONeal) commented Oct 28, 2019 •

Copy link
Copy Markdown
Member

Resolves #85 / DevCom-706195

Description

Casey applying the new atomic implementation fixed us breaking the strict aliasing rules, but the memcpy is causing a code size regression for non-/Oi customers. This change should restore code size for the most common uses of atomic, which are atomic and atomic.

Checklist

If you're unsure about a box, leave it unchecked. A maintainer will help you.

  • I understand README.md. I also understand that acceptance of
    community PRs will be delayed until the test and CI systems are online.
  • Identifiers in product code changes are properly _Ugly as per
    https://eel.is/c++draft/lex.name#3.1 or there are no product code changes.
  • The STL builds successfully and all tests have passed
  • These changes introduce no known ABI breaks (adding members, renaming
    members, adding virtual functions, changing whether a type is an aggregate
    or trivially copyable, etc.).
  • These changes were written from scratch using only this repository and
    the C++ Working Draft as a reference (and any other cited standards).
    If they were derived from a project that's already listed in NOTICE.txt,
    that's fine, but please mention it. If they were derived from any other
    project (including Boost and libc++, which are not yet listed in
    NOTICE.txt), you must mention it here, so we can determine whether the
    license is compatible and what else needs to be done.

Resolves microsoft#85 / DevCom-706195

Casey applying the new atomic implementation fixed us breaking the
strict aliasing rules, but the memcpy is causing a code size regression
for non-`/Oi` customers. This change should restore code size for the
most common uses of atomic, which are `atomic` and
`atomic`.
@BillyONeal
Billy O'Neal (BillyONeal) requested a review from a team as a code owner October 28, 2019 21:17
@BillyONeal Billy O'Neal (BillyONeal) changed the title Use static_cast in _Atomic_reinterpret_as for integral types. Use static_cast in _Atomic_reinterpret_as for integral and pointer types. Oct 28, 2019
Comment thread stl/inc/atomic
@BillyONeal Billy O'Neal (BillyONeal) changed the title Use static_cast in _Atomic_reinterpret_as for integral and pointer types. Use casts in _Atomic_reinterpret_as for integral and pointer types. Oct 28, 2019
@BillyONeal
Billy O'Neal (BillyONeal) merged commit 5bf80b4 into microsoft:master Oct 28, 2019
@BillyONeal
Billy O'Neal (BillyONeal) deleted the static_cast_atomic branch October 28, 2019 22:50
fengjixuchui added a commit to fengjixuchui/STL that referenced this pull request Oct 29, 2019
Use casts for most common atomic cases (microsoft#227)
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.

: _Atomic_reinterpret_as should use static_cast instead of memcpy where possible

3 participants