From patchwork Mon Jan 15 20:42:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [esnacc-dev] cxx-lib/asn-buf: fix a large parameter pass-by-value X-Patchwork-Submitter: Aaron Conole X-Patchwork-Id: 25 X-Patchwork-Delegate: aconole@bytheb.org Message-Id: <20180115204233.11758-1-aconole@bytheb.org> To: dev@lists.esnacc.org Date: Mon, 15 Jan 2018 15:42:33 -0500 From: Aaron Conole List-Id: eSNACC Development discussion The BufferException object is quite large (>512 bytes), which incurrs a performance impact. Convert the pass-by-value to a pass-by-reference. Fixes: ea172d558054 ("cxx-lib/src/asn-buf: make GetSeg non-throwing.") Signed-off-by: Aaron Conole --- cxx-lib/src/asn-buf.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cxx-lib/src/asn-buf.cpp b/cxx-lib/src/asn-buf.cpp index c599182..2591bec 100644 --- a/cxx-lib/src/asn-buf.cpp +++ b/cxx-lib/src/asn-buf.cpp @@ -208,7 +208,7 @@ char * AsnBuf::GetSeg(long segLen) const try { GetSeg(seg, segLen); - } catch (BufferException) { + } catch (BufferException &) { delete [] seg; seg = NULL; }