[PATCH] D93531: [clangd] Reuse buffer for JSONTransport::readRawMessage

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 18 03:56:52 PST 2020


njames93 created this revision.
njames93 added a reviewer: sammccall.
Herald added subscribers: usaxena95, kadircet, arphaman.
njames93 requested review of this revision.
Herald added subscribers: cfe-commits, MaskRay, ilya-biryukov.
Herald added a project: clang.

Reusing the buffers for reading messages will alleviate some malloc pressure, alluded to in D93452 <https://reviews.llvm.org/D93452>.
This is potentially unsafe as the StringRef returned will be invalidated on sucessive calls and its not thread-safe.
However given there is only 1 call site those both appear to be non-issues.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D93531

Files:
  clang-tools-extra/clangd/JSONTransport.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D93531.312750.patch
Type: text/x-patch
Size: 4688 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201218/282d2b12/attachment.bin>


More information about the cfe-commits mailing list