Github user PSUdaemon commented on a diff in the pull request:

    https://github.com/apache/trafficserver/pull/1025#discussion_r79040648
  
    --- Diff: proxy/logging/LogObject.cc ---
    @@ -354,6 +354,38 @@ LogObject::display(FILE *fd)
       fprintf(fd, 
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
     }
     
    +static head_p
    +increment_pointer_version(volatile head_p *dst)
    +{
    +  head_p h;
    +  head_p new_h;
    +
    +  do {
    +    INK_QUEUE_LD(h, *dst);
    +    SET_FREELIST_POINTER_VERSION(new_h, FREELIST_POINTER(h), 
FREELIST_VERSION(h) + 1);
    +  } while (ink_atomic_cas(&dst->data, h.data, new_h.data) == false);
    +
    +  return h;
    +}
    +
    +static bool
    +write_pointer_value(volatile head_p *dst, head_p old_h, void *ptr)
    +{
    +  head_p tmp_h;
    +
    +  SET_FREELIST_POINTER_VERSION(tmp_h, ptr, 0);
    +  return ink_atomic_cas(&dst->data, old_h.data, tmp_h.data);
    +}
    +
    +static bool
    +write_pointer_value_vers(volatile head_p *dst, head_p old_h, void *ptr, 
head_p::version_type vers)
    +{
    +  head_p tmp_h;
    +
    +  SET_FREELIST_POINTER_VERSION(tmp_h, ptr, vers);
    +  return ink_atomic_cas(&dst->data, old_h.data, tmp_h.data);
    +}
    --- End diff --
    
    Can these two functions be merged? Seems like `write_pointer_value` can 
just call `write_pointer_value_vers` with `0` for the version?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to