You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by so...@apache.org on 2014/02/27 00:42:34 UTC
git commit: TS-2592: Use proxy allocator for ioBufAllocator
Repository: trafficserver
Updated Branches:
refs/heads/master 2c426f8ad -> 2fbd4b64a
TS-2592: Use proxy allocator for ioBufAllocator
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/2fbd4b64
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/2fbd4b64
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/2fbd4b64
Branch: refs/heads/master
Commit: 2fbd4b64ab6176fe462ce10668303687dd3e48d0
Parents: 2c426f8
Author: Phil Sorber <so...@apache.org>
Authored: Wed Feb 26 16:30:50 2014 -0700
Committer: Phil Sorber <so...@apache.org>
Committed: Wed Feb 26 16:41:28 2014 -0700
----------------------------------------------------------------------
CHANGES | 2 ++
iocore/eventsystem/P_IOBuffer.h | 10 +++++-----
proxy/http/HttpTransact.cc | 2 +-
proxy/http/HttpTransact.h | 2 +-
4 files changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2fbd4b64/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 5b374ec..a000c95 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
-*- coding: utf-8 -*-
Changes with Apache Traffic Server 5.0.0
+ *) [TS-2592] Use proxy allocator for ioBufAllocator
+
*) [TS-2576] Add Oct/Hex escape representation into LogFormat
*) [TS-2494] fix the crash that return the stale cached document
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2fbd4b64/iocore/eventsystem/P_IOBuffer.h
----------------------------------------------------------------------
diff --git a/iocore/eventsystem/P_IOBuffer.h b/iocore/eventsystem/P_IOBuffer.h
index 20e1405..c82cd33 100644
--- a/iocore/eventsystem/P_IOBuffer.h
+++ b/iocore/eventsystem/P_IOBuffer.h
@@ -290,7 +290,7 @@ IOBufferData::alloc(int64_t size_index, AllocType type)
switch (type) {
case MEMALIGNED:
if (BUFFER_SIZE_INDEX_IS_FAST_ALLOCATED(size_index))
- _data = (char *) ioBufAllocator[size_index].alloc_void();
+ _data = (char *) THREAD_ALLOC(ioBufAllocator[size_index], this_thread());
// coverity[dead_error_condition]
else if (BUFFER_SIZE_INDEX_IS_XMALLOCED(size_index))
_data = (char *)ats_memalign(ats_pagesize(), index_to_buffer_size(size_index));
@@ -298,7 +298,7 @@ IOBufferData::alloc(int64_t size_index, AllocType type)
default:
case DEFAULT_ALLOC:
if (BUFFER_SIZE_INDEX_IS_FAST_ALLOCATED(size_index))
- _data = (char *) ioBufAllocator[size_index].alloc_void();
+ _data = (char *) THREAD_ALLOC(ioBufAllocator[size_index], this_thread());
else if (BUFFER_SIZE_INDEX_IS_XMALLOCED(size_index))
_data = (char *)ats_malloc(BUFFER_SIZE_FOR_XMALLOC(size_index));
break;
@@ -317,14 +317,14 @@ IOBufferData::dealloc()
switch (_mem_type) {
case MEMALIGNED:
if (BUFFER_SIZE_INDEX_IS_FAST_ALLOCATED(_size_index))
- ioBufAllocator[_size_index].free_void(_data);
+ THREAD_FREE(_data, ioBufAllocator[_size_index], this_thread());
else if (BUFFER_SIZE_INDEX_IS_XMALLOCED(_size_index))
::free((void *) _data);
break;
default:
case DEFAULT_ALLOC:
if (BUFFER_SIZE_INDEX_IS_FAST_ALLOCATED(_size_index))
- ioBufAllocator[_size_index].free_void(_data);
+ THREAD_FREE(_data, ioBufAllocator[_size_index], this_thread());
else if (BUFFER_SIZE_INDEX_IS_XMALLOCED(_size_index))
ats_free(_data);
break;
@@ -536,7 +536,7 @@ IOBufferBlock::realloc(int64_t i)
return;
ink_release_assert(i > data->_size_index && i != BUFFER_SIZE_NOT_ALLOCATED);
- void *b = ioBufAllocator[i].alloc_void();
+ void *b = THREAD_ALLOC(ioBufAllocator[i], this_thread());
realloc_set_internal(b, BUFFER_SIZE_FOR_INDEX(i), i);
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2fbd4b64/proxy/http/HttpTransact.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index 650b09f..8052a38 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -5493,7 +5493,7 @@ HttpTransact::handle_trace_and_options_requests(State* s, HTTPHdr* incoming_hdr)
if (s->internal_msg_buffer_size <= max_iobuffer_size) {
s->internal_msg_buffer_fast_allocator_size = buffer_size_to_index(s->internal_msg_buffer_size);
- s->internal_msg_buffer = (char *) ioBufAllocator[s->internal_msg_buffer_fast_allocator_size].alloc_void();
+ s->internal_msg_buffer = (char *) THREAD_ALLOC(ioBufAllocator[s->internal_msg_buffer_fast_allocator_size], this_thread());
} else {
s->internal_msg_buffer_fast_allocator_size = -1;
s->internal_msg_buffer = (char *)ats_malloc(s->internal_msg_buffer_size);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2fbd4b64/proxy/http/HttpTransact.h
----------------------------------------------------------------------
diff --git a/proxy/http/HttpTransact.h b/proxy/http/HttpTransact.h
index 4513940..652df7f 100644
--- a/proxy/http/HttpTransact.h
+++ b/proxy/http/HttpTransact.h
@@ -1389,7 +1389,7 @@ HttpTransact::free_internal_msg_buffer(char *buffer, int64_t size)
{
ink_assert(buffer);
if (size >= 0) {
- ioBufAllocator[size].free_void(buffer);
+ THREAD_FREE(buffer, ioBufAllocator[size], this_thread());
} else {
ats_free(buffer);
}