From 97cb532f668dd78a5100abb07d7500cbd36b6198 Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Sat, 19 May 2018 20:36:39 +0200 Subject: [PATCH] logicsegment.cpp: Suggest inlining of pack_sample()/unpack_sample(). These functions were not inlined by default (tested with gcc 7.3.0). They're in a hot code path, so inlining can help with performance here. --- pv/data/logicsegment.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pv/data/logicsegment.cpp b/pv/data/logicsegment.cpp index 3896ff21..707f797d 100644 --- a/pv/data/logicsegment.cpp +++ b/pv/data/logicsegment.cpp @@ -64,7 +64,7 @@ LogicSegment::~LogicSegment() free(l.data); } -uint64_t LogicSegment::unpack_sample(const uint8_t *ptr) const +inline uint64_t LogicSegment::unpack_sample(const uint8_t *ptr) const { #ifdef HAVE_UNALIGNED_LITTLE_ENDIAN_ACCESS return *(uint64_t*)ptr; @@ -102,7 +102,7 @@ uint64_t LogicSegment::unpack_sample(const uint8_t *ptr) const #endif } -void LogicSegment::pack_sample(uint8_t *ptr, uint64_t value) +inline void LogicSegment::pack_sample(uint8_t *ptr, uint64_t value) { #ifdef HAVE_UNALIGNED_LITTLE_ENDIAN_ACCESS *(uint64_t*)ptr = value; -- 2.30.2