rupprecht wrote: > LGTM. Maybe an opportunity to use a unique_ptr with a custom deleter? > Something like: > > ``` > struct TrackingOutputBufferDeleter { > void operator()(TrackingOutputBuffer* TOB) { > if (!TOB) > return; > std::free(TOB->getBuffer()); > std::free(TOB); > } > }; > ```
Sent #142815. The suggestion is almost perfect. The buffer can be free'd, but TOB must be deleted, otherwise there's a mismatch: `alloc-dealloc-mismatch (operator new vs free)`. https://github.com/llvm/llvm-project/pull/142676 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits