projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Speed up analog trace painting
[pulseview.git]
/
pv
/
data
/
segment.cpp
diff --git
a/pv/data/segment.cpp
b/pv/data/segment.cpp
index ceaf0a056ef84a2c8f473f1d664559b4e583ce1e..81e8dd6d356f1ae6784dd0773cf0f6cc2e2f5953 100644
(file)
--- a/
pv/data/segment.cpp
+++ b/
pv/data/segment.cpp
@@
-117,8
+117,7
@@
void Segment::append_single_sample(void *data)
// There will always be space for at least one sample in
// the current chunk, so we do not need to test for space
// There will always be space for at least one sample in
// the current chunk, so we do not need to test for space
- memcpy(current_chunk_ + (used_samples_ * unit_size_),
- data, unit_size_);
+ memcpy(current_chunk_ + (used_samples_ * unit_size_), data, unit_size_);
used_samples_++;
unused_samples_--;
used_samples_++;
unused_samples_--;
@@
-220,16
+219,12
@@
SegmentRawDataIterator* Segment::begin_raw_sample_iteration(uint64_t start)
void Segment::continue_raw_sample_iteration(SegmentRawDataIterator* it, uint64_t increase)
{
void Segment::continue_raw_sample_iteration(SegmentRawDataIterator* it, uint64_t increase)
{
- lock_guard<recursive_mutex> lock(mutex_);
-
+ // Fail gracefully if we are asked to deliver data we don't have
if (it->sample_index > sample_count_)
if (it->sample_index > sample_count_)
- {
- // Fail gracefully if we are asked to deliver data we don't have
return;
return;
- } else {
- it->sample_index += increase;
- it->chunk_offs += (increase * unit_size_);
- }
+
+ it->sample_index += increase;
+ it->chunk_offs += (increase * unit_size_);
if (it->chunk_offs > (chunk_size_ - 1)) {
it->chunk_num++;
if (it->chunk_offs > (chunk_size_ - 1)) {
it->chunk_num++;
@@
-252,6
+247,5
@@
void Segment::end_raw_sample_iteration(SegmentRawDataIterator* it)
}
}
}
}
-
} // namespace data
} // namespace pv
} // namespace data
} // namespace pv