[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 07/22: Fix(?) prune_tags: needs verificatio
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 07/22: Fix(?) prune_tags: needs verification |
Date: |
Wed, 24 Sep 2014 22:07:38 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
trondeau pushed a commit to branch master
in repository gnuradio.
commit e1061a60d9c668a910ac8e84ee9d992cda384358
Author: Doug Geiger <address@hidden>
Date: Fri Sep 19 11:00:33 2014 -0400
Fix(?) prune_tags: needs verification
---
gnuradio-runtime/include/gnuradio/buffer.h | 3 +--
gnuradio-runtime/lib/buffer.cc | 41 +++++-------------------------
2 files changed, 7 insertions(+), 37 deletions(-)
diff --git a/gnuradio-runtime/include/gnuradio/buffer.h
b/gnuradio-runtime/include/gnuradio/buffer.h
index d40417e..305e778 100644
--- a/gnuradio-runtime/include/gnuradio/buffer.h
+++ b/gnuradio-runtime/include/gnuradio/buffer.h
@@ -28,7 +28,7 @@
#include <gnuradio/tags.h>
#include <boost/weak_ptr.hpp>
#include <gnuradio/thread/thread.h>
-#include <deque>
+#include <map>
namespace gr {
@@ -158,7 +158,6 @@ namespace gr {
uint64_t d_abs_write_offset; // num items
written since the start
bool d_done;
std::multimap<uint64_t,tag_t> d_item_tags;
- //std::deque<tag_t> d_item_tags;
uint64_t d_last_min_items_read;
unsigned index_add(unsigned a, unsigned b)
diff --git a/gnuradio-runtime/lib/buffer.cc b/gnuradio-runtime/lib/buffer.cc
index 346bb58..079cfe3 100644
--- a/gnuradio-runtime/lib/buffer.cc
+++ b/gnuradio-runtime/lib/buffer.cc
@@ -23,7 +23,7 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
-
+#include <algorithm>
#include <gnuradio/buffer.h>
#include <gnuradio/math.h>
#include "vmcircbuf.h"
@@ -226,7 +226,6 @@ namespace gr {
{
gr::thread::scoped_lock guard(*mutex());
d_item_tags.insert(std::pair<uint64_t,tag_t>(tag.offset,tag));
- //d_item_tags.push_back(tag);
}
void
@@ -234,10 +233,9 @@ namespace gr {
{
gr::thread::scoped_lock guard(*mutex());
// TODO: we can probably do this more efficiently now ...
-// for(std::deque<tag_t>::iterator it = d_item_tags.begin(); it !=
d_item_tags.end(); ++it) {
for(std::multimap<uint64_t,tag_t>::iterator it = d_item_tags.begin(); it
!= d_item_tags.end(); ++it) {
if((*it).second == tag) {
- (*it).second.marked_deleted.push_back(id);
+ (*it).second.marked_deleted.push_back(id);
}
}
}
@@ -253,38 +251,11 @@ namespace gr {
If this function is used elsewhere, remember to lock the
buffer's mutex al la the scoped_lock line below.
*/
- //gr::thread::scoped_lock guard(*mutex());
-#if 0
- for(size_t i=0; i<d_item_tags.size(); ){
- const tag_t &tag = d_item_tags.at(i);
- uint64_t item_time = tag.offset;
- if(item_time+d_max_reader_delay + bufsize() < max_time) {
- d_item_tags.erase(d_item_tags.begin()+i);
- continue;
- }
- i++;
- }
-#endif
-#if 1
- std::multimap<uint64_t,tag_t>::iterator itr(d_item_tags.begin());
-
- uint64_t item_time;
- // Since tags are not guarenteed to be in any particular order, we
- // need to erase here instead of pop_front. An erase in the middle
- // invalidates all iterators; so this resets the iterator to find
- // more. Mostly, we will be erasing from the front and
- // therefore lose little time this way.
- while(itr != d_item_tags.end()) {
- item_time = (*itr).second.offset;
- if(item_time+d_max_reader_delay + bufsize() < max_time) {
- //d_item_tags.erase(itr);
- //itr = d_item_tags.begin();
- itr++;
- }
- else
- itr++;
+ std::multimap<uint64_t, tag_t>::iterator itr =
d_item_tags.lower_bound(max_time);
+ while (itr != d_item_tags.end()) {
+ d_item_tags.erase(itr);
+ itr++;
}
-#endif
}
long
- [Commit-gnuradio] [gnuradio] branch master updated (6e12074 -> fd0955f), git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 04/22: volk: add feature for json results export, git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 03/22: Fix CMake abuse for assembly (.s) files, git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 02/22: blocks: make tagged stream to pdu output optional, git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 08/22: Fix prune_tags, git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 01/22: Add vector support to abs block. Remove unused num_inputs from xml., git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 05/22: blocks: Added callback to vector source GRC bindings, git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 07/22: Fix(?) prune_tags: needs verification,
git <=
- [Commit-gnuradio] [gnuradio] 15/22: digital: clock recovery fix relative limit, git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 21/22: Merge branch 'master' of git.gnuradio.org:gnuradio, git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 13/22: fec: turning off some debug output., git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 10/22: Formatting fix-ups, git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 19/22: digital: applying same fix of the complex M&M clock recovery block as the float version., git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 14/22: blocks: deinterleaver will process more than one block at a time for significant speed improvements., git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 06/22: tags_wip, git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 22/22: Merge branch 'maint', git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 09/22: runtime: speed up all the things, git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 12/22: docs: fixed path stripping for binary dirs in doxygen manual., git, 2014/09/24