Skip to content

Conversation

@SolidWallOfCode
Copy link
Member

  • Remove use of Tokenizer to avoid allocation.
  • MultiTexMod leaks the duplicated strings.
  • Avoid allocation per string, use a single allocation to store the original string and views for the separate tokens.

See #9664.

@SolidWallOfCode SolidWallOfCode added this to the 10.0.0 milestone May 3, 2023
@SolidWallOfCode SolidWallOfCode self-assigned this May 3, 2023
Copy link
Contributor

@bneradt bneradt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. In addition to solving the leak, this simplifies things pretty well.


struct MultiTextMod : public ControlBase::Modifier {
std::vector<swoc::MemSpan<char>> text_vec;
std::string _s; ///< Storage for all strings.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably good to make _s private.

@SolidWallOfCode SolidWallOfCode merged commit 0a5df0e into apache:master May 3, 2023
cmcfarlen pushed a commit to cmcfarlen/trafficserver that referenced this pull request Jun 3, 2024
* asf/master: (33 commits)
  Add error log for invalid OCSP response (apache#9674)
  Add new settings to specify TLS versions to use (apache#9667)
  Remove flask from tests/Pipfile (apache#9688)
  Doc: Add example of --enable-lto build option with LLVM (apache#9654)
  Added Zhengxi to the asf contributors (apache#9685)
  Don't build native QUIC implementation (apache#9670)
  Stabilize autest tls_hooks17 (apache#9671)
  Cleanup: remove ts::buffer from HostDB. (apache#9677)
  Fix leak in MultiTextMod in ControlBase. (apache#9675)
  Cleanup: remove TsBuffer.h from MIME.cc (apache#9661)
  Cleanup: remove ts::Buffer from ControlBase. (apache#9664)
  setup pre-commit hook at cmake generation time (apache#9669)
  Updated parent retry attempt logic (apache#9620)
  Try to do less work in hot function HttpHookState::getNext (apache#9660)
  cmake build, fixed warning using older openssl APIs (apache#9648)
  rename attempts to retry_attempts (apache#9655)
  OCSP: Fix unitialized variable error. (apache#9662)
  Add support for CONNECT method on HTTP/2 connection (apache#9616)
  Remove deprecated debug output functions from 10 source files. (apache#9657)
  Remove deprecated debug output functions from 14 source files. (apache#9658)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants