You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ma...@apache.org on 2018/03/15 08:35:02 UTC

[trafficserver] branch quic-latest updated: Move ats_unique_buf to ink_memory

This is an automated email from the ASF dual-hosted git repository.

maskit pushed a commit to branch quic-latest
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/quic-latest by this push:
     new e86ea38  Move ats_unique_buf to ink_memory
e86ea38 is described below

commit e86ea3860f2ca5ca74f7c8322e61abba2e0ad635
Author: Masakazu Kitajo <ma...@apache.org>
AuthorDate: Thu Mar 15 15:24:05 2018 +0900

    Move ats_unique_buf to ink_memory
---
 iocore/net/quic/QUICTypes.cc | 6 ------
 iocore/net/quic/QUICTypes.h  | 4 ----
 lib/ts/ink_memory.cc         | 6 ++++++
 lib/ts/ink_memory.h          | 4 ++++
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/iocore/net/quic/QUICTypes.cc b/iocore/net/quic/QUICTypes.cc
index 1fe1fdc..077e26d 100644
--- a/iocore/net/quic/QUICTypes.cc
+++ b/iocore/net/quic/QUICTypes.cc
@@ -24,12 +24,6 @@
 #include "QUICTypes.h"
 #include "QUICIntUtil.h"
 
-ats_unique_buf
-ats_unique_malloc(size_t size)
-{
-  return ats_unique_buf(reinterpret_cast<uint8_t *>(ats_malloc(size)), [](void *p) { ats_free(p); });
-}
-
 bool
 QUICTypeUtil::has_long_header(const uint8_t *buf)
 {
diff --git a/iocore/net/quic/QUICTypes.h b/iocore/net/quic/QUICTypes.h
index 7a36484..25c1aab 100644
--- a/iocore/net/quic/QUICTypes.h
+++ b/iocore/net/quic/QUICTypes.h
@@ -37,10 +37,6 @@
 #define MAGIC_NUMBER_1 1
 #define MAGIC_NUMBER_TRUE true
 
-// TODO: move to lib/ts/ink_memory.h?
-using ats_unique_buf = std::unique_ptr<uint8_t, decltype(&ats_free)>;
-ats_unique_buf ats_unique_malloc(size_t size);
-
 using QUICPacketNumber = uint64_t;
 using QUICVersion      = uint32_t;
 using QUICStreamId     = uint64_t;
diff --git a/lib/ts/ink_memory.cc b/lib/ts/ink_memory.cc
index a45f147..d3152bc 100644
--- a/lib/ts/ink_memory.cc
+++ b/lib/ts/ink_memory.cc
@@ -161,6 +161,12 @@ ats_mallopt(int param ATS_UNUSED, int value ATS_UNUSED)
   return 0;
 }
 
+ats_unique_buf
+ats_unique_malloc(size_t size)
+{
+  return ats_unique_buf(reinterpret_cast<uint8_t *>(ats_malloc(size)), [](void *p) { ats_free(p); });
+}
+
 int
 ats_msync(caddr_t addr, size_t len, caddr_t end, int flags)
 {
diff --git a/lib/ts/ink_memory.h b/lib/ts/ink_memory.h
index e566867..52d45ce 100644
--- a/lib/ts/ink_memory.h
+++ b/lib/ts/ink_memory.h
@@ -590,6 +590,10 @@ path_join(ats_scoped_str const &lhs, ats_scoped_str const &rhs)
 
   return x.release();
 }
+
+using ats_unique_buf = std::unique_ptr<uint8_t, decltype(&ats_free)>;
+ats_unique_buf ats_unique_malloc(size_t size);
+
 #endif /* __cplusplus */
 
 #endif

-- 
To stop receiving notification emails like this one, please contact
maskit@apache.org.