Uploaded image for project: 'Traffic Server'
  1. Traffic Server
  2. TS-3236

Simplify usage around TS_HAS_128BIT_CAS and freelist items

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • 8.0.0
    • Core

    Description

      In various places of the code, we have patterns like

      #if TS_HAS_128BIT_CAS
             result = ink_atomic_cas((__int128_t*) &m_log_buffer.data, old_h.data, tmp_h.data);
      #else
             result = ink_atomic_cas((int64_t *) &m_log_buffer.data, old_h.data, tmp_h.data);
      #endif
      

      This is rather unfortunate IMO, since it means it's fairly easy to make a mistake such that the wrong CAS operator is used. I see at least two options:

      1) Remove the check entirely, and always assume we have a 128-bit CAS available?

      2) Add some typedef'ery around the code, such that only the core (queue) implementation needs to know about 64-bit vs 128-bit CAS. So the above would be eliminated to use a single ink_atomic_cas() without type casting.

      Attachments

        Activity

          People

            jkenny Jason Kenny
            zwoop Leif Hedstrom
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: