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

Replace atomic_ops with std::atomic #3082

Merged
merged 18 commits into from
Jan 24, 2024
Merged

Commits on Jan 24, 2024

  1. Configuration menu
    Copy the full SHA
    14847b3 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7ec430f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6c96438 View commit details
    Browse the repository at this point in the history
  4. Switch from AO_t -> atomic_int in atomic.d

    No longer need to include atomic_ops.h
    d-torrance committed Jan 24, 2024
    Configuration menu
    Copy the full SHA
    0dbab0b View commit details
    Browse the repository at this point in the history
  5. Explicitly include assert header

    Previously, it was included via atomic_ops.h.
    d-torrance committed Jan 24, 2024
    Configuration menu
    Copy the full SHA
    904f072 View commit details
    Browse the repository at this point in the history
  6. Move definition of atomic_field struct to its own header

    Used in both d and system directories
    d-torrance committed Jan 24, 2024
    Configuration menu
    Copy the full SHA
    45a484e View commit details
    Browse the repository at this point in the history
  7. Replace atomic_ops with std::atomic in supervisor directory

    We also include atomic-exports.h instead of copy/pasting its
    contents.
    d-torrance committed Jan 24, 2024
    Configuration menu
    Copy the full SHA
    7c8ceb0 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    1d97083 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    e97138f View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    c181c6f View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    6c4bdea View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    293d9a9 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    88616db View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    2bd80dc View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    65b4a0c View commit details
    Browse the repository at this point in the history
  16. Don't cast to atomic_int in test(atomicField)

    "load" returns an int anyway, and this was causing a fatal error on
    macOS:
    
    CC interrupts-tmp.c
    ../../../../Macaulay2/d/interrupts.d:25:100: fatal error: used type 'atomic_int' (aka '_Atomic(int)') where arithmetic or pointer type is required
      tmp__5 = (load_Field((*((struct atomic_field*)TS_Get_Local(interrupts_interruptedFlag_id)))) != ((atomic_int)0));
                                                                                                       ^           ~
    d-torrance committed Jan 24, 2024
    Configuration menu
    Copy the full SHA
    8228ef5 View commit details
    Browse the repository at this point in the history
  17. Refactor store() for atomicField/atomicFieldPointer to take an int

    Otherwise, we get compile errors using clang, e.g.:
    
    CC interrupts-tmp.c
    ../../../../Macaulay2/d/interrupts.d:25:85: fatal error: used type 'atomic_int' (aka '_Atomic(int)') where arithmetic or pointer type is required
      store_Field((*((struct atomic_field*)TS_Get_Local(interrupts_exceptionFlag_id))),((atomic_int)tmp__4));
                                                                                        ^           ~~~~~~
    ../../../../Macaulay2/d/../../include/M2/atomic-field.h:20:52: note: expanded from macro 'store_Field'
     #define store_Field(x,val) atomic_store(&(x).field,val)
                                                        ^~~
    /Applications/Xcode_14.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include/stdatomic.h:121:66: note: expanded from macro 'atomic_store'
     #define atomic_store(object, desired) __c11_atomic_store(object, desired, __ATOMIC_SEQ_CST)
                                                                      ^~~~~~~
    d-torrance committed Jan 24, 2024
    Configuration menu
    Copy the full SHA
    0b7fbc6 View commit details
    Browse the repository at this point in the history
  18. Remove cruft in atomic.d

    There were lots of things we were never actually using
    d-torrance committed Jan 24, 2024
    Configuration menu
    Copy the full SHA
    cb26506 View commit details
    Browse the repository at this point in the history