You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2021/07/20 18:09:37 UTC
[trafficserver] branch master updated: Make the InkAPI
mHandleAllocator be a Proxy Allocator (#8074)
This is an automated email from the ASF dual-hosted git repository.
zwoop pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new bcb54b5 Make the InkAPI mHandleAllocator be a Proxy Allocator (#8074)
bcb54b5 is described below
commit bcb54b5ac4e796f12d0edacbb5105ded12fac2c9
Author: Leif Hedstrom <zw...@apache.org>
AuthorDate: Tue Jul 20 12:09:26 2021 -0600
Make the InkAPI mHandleAllocator be a Proxy Allocator (#8074)
---
iocore/eventsystem/I_Thread.h | 1 +
src/traffic_server/InkAPI.cc | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/iocore/eventsystem/I_Thread.h b/iocore/eventsystem/I_Thread.h
index d10a612..3c7905b 100644
--- a/iocore/eventsystem/I_Thread.h
+++ b/iocore/eventsystem/I_Thread.h
@@ -134,6 +134,7 @@ public:
ProxyAllocator ioDataAllocator;
ProxyAllocator ioAllocator;
ProxyAllocator ioBlockAllocator;
+ ProxyAllocator mHandleAllocator;
/** Start the underlying thread.
diff --git a/src/traffic_server/InkAPI.cc b/src/traffic_server/InkAPI.cc
index 427c6f1..7194ce7 100644
--- a/src/traffic_server/InkAPI.cc
+++ b/src/traffic_server/InkAPI.cc
@@ -773,7 +773,7 @@ isWriteable(TSMBuffer bufp)
static MIMEFieldSDKHandle *
sdk_alloc_field_handle(TSMBuffer /* bufp ATS_UNUSED */, MIMEHdrImpl *mh)
{
- MIMEFieldSDKHandle *handle = mHandleAllocator.alloc();
+ MIMEFieldSDKHandle *handle = THREAD_ALLOC(mHandleAllocator, this_thread());
// TODO: Should remove this when memory allocation can't fail.
sdk_assert(sdk_sanity_check_null_ptr((void *)handle) == TS_SUCCESS);
@@ -788,7 +788,7 @@ static void
sdk_free_field_handle(TSMBuffer bufp, MIMEFieldSDKHandle *field_handle)
{
if (sdk_sanity_check_mbuffer(bufp) == TS_SUCCESS) {
- mHandleAllocator.free(field_handle);
+ THREAD_FREE(field_handle, mHandleAllocator, this_thread());
}
}