masaori335 commented on code in PR #11890: URL: https://github.com/apache/trafficserver/pull/11890#discussion_r1935002693
########## src/iocore/eventsystem/P_PipeIOBuffer.h: ########## @@ -0,0 +1,503 @@ +// +// Created by Yihong Jin on 1/26/25. +// +#pragma once + +#include "tscore/ink_platform.h" +#include "tscore/ink_resource.h" + +#if TS_USE_LINUX_SPLICE +extern ClassAllocator<PipeIOBuffer> pipeIOAllocator; + +TS_INLINE PipeIOBuffer * +new_PipeIOBuffer_internal(const char *location, int64_t pipe_capacity) +{ + PipeIOBuffer *b = THREAD_ALLOC(pipeIOAllocator, this_thread()); + b->_location = location; + b->alloc(pipe_capacity); + b->water_mark = 0; + return b; +} + +TS_INLINE void +free_PipeIOBuffer(PipeIOBuffer *mio) +{ + // static cast to PipeIOBuffer + PipeIOBuffer *b = static_cast<PipeIOBuffer *>(mio); + b->clear(); + THREAD_FREE(b, pipeIOAllocator, this_thread()); +} + +////////////////////////////////////////////////////////////////// +// +// class PipeIOBufferReader -- +// inline functions definitions +// +////////////////////////////////////////////////////////////////// +TS_INLINE char * +PipeIOBufferReader::start() +{ + throw std::runtime_error("Not applicable for PipeIOBufferReader"); Review Comment: Hmm, this PR is pretty interesting as concept. However, overriding bunch of methods and throwing runtime errors like this is indicating something is wrong with class design. ( Also, please note that ATS doesn't use Exception in these fundamental code ) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@trafficserver.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org