diff --git a/proxy/http/Http1ClientSession.cc b/proxy/http/Http1ClientSession.cc index 1cdd7563f7d..34602d0dc80 100644 --- a/proxy/http/Http1ClientSession.cc +++ b/proxy/http/Http1ClientSession.cc @@ -57,7 +57,7 @@ ink_mutex debug_cs_list_mutex; #endif /* USE_HTTP_DEBUG_LISTS */ -ClassAllocator http1ClientSessionAllocator("http1ClientSessionAllocator"); +ClassAllocator http1ClientSessionAllocator("http1ClientSessionAllocator"); Http1ClientSession::Http1ClientSession() : super(), trans(this) {} @@ -120,7 +120,6 @@ Http1ClientSession::free() _vc = nullptr; } - this->~Http1ClientSession(); THREAD_FREE(this, http1ClientSessionAllocator, this_thread()); } diff --git a/proxy/http/Http1ClientSession.h b/proxy/http/Http1ClientSession.h index 15098067c42..4c4d0deba42 100644 --- a/proxy/http/Http1ClientSession.h +++ b/proxy/http/Http1ClientSession.h @@ -129,4 +129,4 @@ class Http1ClientSession : public ProxySession Http1Transaction trans; }; -extern ClassAllocator http1ClientSessionAllocator; +extern ClassAllocator http1ClientSessionAllocator; diff --git a/proxy/http/Http1ServerSession.cc b/proxy/http/Http1ServerSession.cc index d800b03fe6c..eff73aff78c 100644 --- a/proxy/http/Http1ServerSession.cc +++ b/proxy/http/Http1ServerSession.cc @@ -36,7 +36,7 @@ #include "HttpSessionManager.h" #include "HttpSM.h" -ClassAllocator httpServerSessionAllocator("httpServerSessionAllocator"); +ClassAllocator httpServerSessionAllocator("httpServerSessionAllocator"); void Http1ServerSession::destroy() @@ -50,7 +50,6 @@ Http1ServerSession::destroy() } mutex.clear(); - this->~Http1ServerSession(); if (httpSessionManager.get_pool_type() == TS_SERVER_SESSION_SHARING_POOL_THREAD) { THREAD_FREE(this, httpServerSessionAllocator, this_thread()); } else { diff --git a/proxy/http/Http1ServerSession.h b/proxy/http/Http1ServerSession.h index 95e7ebc4079..0de92de92a2 100644 --- a/proxy/http/Http1ServerSession.h +++ b/proxy/http/Http1ServerSession.h @@ -107,7 +107,7 @@ class Http1ServerSession : public PoolableSession IOBufferReader *buf_reader = nullptr; }; -extern ClassAllocator httpServerSessionAllocator; +extern ClassAllocator httpServerSessionAllocator; //////////////////////////////////////////// // INLINE diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc index 4ffa9a7e89c..711cb7ecd27 100644 --- a/proxy/http/HttpSM.cc +++ b/proxy/http/HttpSM.cc @@ -1819,7 +1819,6 @@ HttpSM::state_http_server_open(int event, void *data) Http1ServerSession *session = (TS_SERVER_SESSION_SHARING_POOL_THREAD == httpSessionManager.get_pool_type()) ? THREAD_ALLOC_INIT(httpServerSessionAllocator, mutex->thread_holding) : httpServerSessionAllocator.alloc(); - new (session) Http1ServerSession(); session->sharing_pool = static_cast(t_state.http_config_param->server_session_sharing_pool); session->sharing_match = static_cast(t_state.txn_conf->server_session_sharing_match); diff --git a/proxy/http/HttpSessionAccept.cc b/proxy/http/HttpSessionAccept.cc index c7d3b1f7ddd..ea9d07556df 100644 --- a/proxy/http/HttpSessionAccept.cc +++ b/proxy/http/HttpSessionAccept.cc @@ -50,7 +50,6 @@ HttpSessionAccept::accept(NetVConnection *netvc, MIOBuffer *iobuf, IOBufferReade } Http1ClientSession *new_session = THREAD_ALLOC_INIT(http1ClientSessionAllocator, this_ethread()); - new (new_session) Http1ClientSession(); new_session->accept_options = static_cast(this); new_session->acl = std::move(acl); diff --git a/proxy/http2/Http2ClientSession.cc b/proxy/http2/Http2ClientSession.cc index 838e0a8d626..5021d181ce2 100644 --- a/proxy/http2/Http2ClientSession.cc +++ b/proxy/http2/Http2ClientSession.cc @@ -47,7 +47,7 @@ this->session_handler = (handler); \ } while (0) -ClassAllocator http2ClientSessionAllocator("http2ClientSessionAllocator"); +ClassAllocator http2ClientSessionAllocator("http2ClientSessionAllocator"); // memcpy the requested bytes from the IOBufferReader, returning how many were // actually copied. @@ -163,7 +163,6 @@ Http2ClientSession::free() free_MIOBuffer(this->read_buffer); free_MIOBuffer(this->write_buffer); - this->~Http2ClientSession(); THREAD_FREE(this, http2ClientSessionAllocator, this_ethread()); } diff --git a/proxy/http2/Http2ClientSession.h b/proxy/http2/Http2ClientSession.h index 2efc66d87be..79ff41cf74f 100644 --- a/proxy/http2/Http2ClientSession.h +++ b/proxy/http2/Http2ClientSession.h @@ -175,7 +175,7 @@ class Http2ClientSession : public ProxySession bool cur_frame_from_early_data = false; }; -extern ClassAllocator http2ClientSessionAllocator; +extern ClassAllocator http2ClientSessionAllocator; /////////////////////////////////////////////// // INLINE diff --git a/proxy/http2/Http2ConnectionState.cc b/proxy/http2/Http2ConnectionState.cc index 1ee9c2b1915..75767523bf3 100644 --- a/proxy/http2/Http2ConnectionState.cc +++ b/proxy/http2/Http2ConnectionState.cc @@ -1220,8 +1220,8 @@ Http2ConnectionState::create_stream(Http2StreamId new_id, Http2Error &error) } } - Http2Stream *new_stream = THREAD_ALLOC_INIT(http2StreamAllocator, this_ethread()); - new (new_stream) Http2Stream(ua_session, new_id, client_settings.get(HTTP2_SETTINGS_INITIAL_WINDOW_SIZE)); + Http2Stream *new_stream = THREAD_ALLOC_INIT(http2StreamAllocator, this_ethread(), ua_session, new_id, + client_settings.get(HTTP2_SETTINGS_INITIAL_WINDOW_SIZE)); ink_assert(nullptr != new_stream); ink_assert(!stream_list.in(new_stream)); diff --git a/proxy/http2/Http2SessionAccept.cc b/proxy/http2/Http2SessionAccept.cc index 3e02dc3a429..f0226fdee86 100644 --- a/proxy/http2/Http2SessionAccept.cc +++ b/proxy/http2/Http2SessionAccept.cc @@ -54,9 +54,8 @@ Http2SessionAccept::accept(NetVConnection *netvc, MIOBuffer *iobuf, IOBufferRead } Http2ClientSession *new_session = THREAD_ALLOC_INIT(http2ClientSessionAllocator, this_ethread()); - new (new_session) Http2ClientSession(); - new_session->acl = std::move(session_acl); - new_session->accept_options = &options; + new_session->acl = std::move(session_acl); + new_session->accept_options = &options; // Pin session to current ET_NET thread new_session->setThreadAffinity(this_ethread()); diff --git a/proxy/http2/Http2Stream.cc b/proxy/http2/Http2Stream.cc index 25a4d640ab2..53146bc2f86 100644 --- a/proxy/http2/Http2Stream.cc +++ b/proxy/http2/Http2Stream.cc @@ -37,7 +37,7 @@ #define Http2StreamDebug(fmt, ...) \ SsnDebug(_proxy_ssn, "http2_stream", "[%" PRId64 "] [%u] " fmt, _proxy_ssn->connection_id(), this->get_id(), ##__VA_ARGS__); -ClassAllocator http2StreamAllocator("http2StreamAllocator"); +ClassAllocator http2StreamAllocator("http2StreamAllocator"); Http2Stream::Http2Stream(ProxySession *session, Http2StreamId sid, ssize_t initial_rwnd) : super(session), _id(sid), _client_rwnd(initial_rwnd) diff --git a/proxy/http2/Http2Stream.h b/proxy/http2/Http2Stream.h index dfac308d0eb..1d8d7b61453 100644 --- a/proxy/http2/Http2Stream.h +++ b/proxy/http2/Http2Stream.h @@ -220,7 +220,7 @@ class Http2Stream : public ProxyTransaction Event *_write_vio_event = nullptr; }; -extern ClassAllocator http2StreamAllocator; +extern ClassAllocator http2StreamAllocator; //////////////////////////////////////////////////// // INLINE