[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 30/148: being more c++y with the ring
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 30/148: being more c++y with the ring |
Date: |
Mon, 15 Aug 2016 00:47:21 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
nwest pushed a commit to annotated tag old_usrp_devel_udp
in repository gnuradio.
commit 473a57e39a509b8232ed61a8bb54b8bd7da9e60a
Author: Josh Blum <address@hidden>
Date: Fri Nov 6 00:03:45 2009 -0800
being more c++y with the ring
---
usrp2/host/lib/eth_data_transport.cc | 1 -
usrp2/host/lib/ring.cc | 15 ++++++---------
usrp2/host/lib/ring.h | 2 +-
usrp2/host/lib/usrp2_impl.cc | 4 ++--
4 files changed, 9 insertions(+), 13 deletions(-)
diff --git a/usrp2/host/lib/eth_data_transport.cc
b/usrp2/host/lib/eth_data_transport.cc
index 6286bfe..2dfae43 100644
--- a/usrp2/host/lib/eth_data_transport.cc
+++ b/usrp2/host/lib/eth_data_transport.cc
@@ -71,7 +71,6 @@ int usrp2::eth_data_transport::sendv(const iovec *iov, size_t
iovlen){
}
std::vector<usrp2::sbuff::sptr> usrp2::eth_data_transport::recv(){
- void *base;
std::vector<sbuff::sptr> sbs;
DEBUG_LOG(":");
// Receive available frames from ethernet buffer. Handler will
diff --git a/usrp2/host/lib/ring.cc b/usrp2/host/lib/ring.cc
index 334ddb4..ac1bda2 100644
--- a/usrp2/host/lib/ring.cc
+++ b/usrp2/host/lib/ring.cc
@@ -28,13 +28,10 @@
namespace usrp2 {
ring::ring(unsigned int entries)
- : d_max(entries), d_read_ind(0), d_write_ind(0), d_ring(entries),
+ : d_max(entries), d_read_ind(0), d_write_ind(0),
+ d_ring(entries, sbuff::make()),
d_mutex(), d_not_empty()
- {
- for (unsigned int i = 0; i < entries; i++) {
- d_ring[i] = sbuff::make(); //load empty sbuff
- }
- }
+ {/*NOP*/}
void
ring::wait_for_not_empty()
@@ -59,13 +56,13 @@ namespace usrp2 {
}
bool
- ring::dequeue(sbuff::sptr *sb)
+ ring::dequeue(sbuff::sptr &sb)
{
gruel::scoped_lock l(d_mutex);
if (empty())
return false;
-
- *sb = d_ring[d_read_ind];
+
+ sb = d_ring[d_read_ind];
d_ring[d_read_ind] = sbuff::make(); //replace it with an empty sbuff
inc_read_ind();
diff --git a/usrp2/host/lib/ring.h b/usrp2/host/lib/ring.h
index 2111134..0e8d76e 100644
--- a/usrp2/host/lib/ring.h
+++ b/usrp2/host/lib/ring.h
@@ -71,7 +71,7 @@ namespace usrp2 {
void wait_for_not_empty();
bool enqueue(sbuff::sptr sb);
- bool dequeue(sbuff::sptr *sb);
+ bool dequeue(sbuff::sptr &sb);
};
} // namespace usrp2
diff --git a/usrp2/host/lib/usrp2_impl.cc b/usrp2/host/lib/usrp2_impl.cc
index 14d673b..d279e06 100644
--- a/usrp2/host/lib/usrp2_impl.cc
+++ b/usrp2/host/lib/usrp2_impl.cc
@@ -583,7 +583,7 @@ namespace usrp2 {
// Iterate through frames and present to user
sbuff::sptr sb;
- while (rp->dequeue(&sb)) {
+ while (rp->dequeue(sb)) {
uint32_t *items; // points to beginning of data
items
size_t nitems_in_uint32s;
rx_metadata md;
@@ -623,7 +623,7 @@ namespace usrp2 {
// Iterate through frames and drop them
sbuff::sptr sb;
- while (rp->dequeue(&sb)) {
+ while (rp->dequeue(sb)) {
sb.reset(); //reset to call cleanup callback
dec_enqueued();
}
- [Commit-gnuradio] [gnuradio] 08/148: Removed omnithreads dependency from libusrp2, still debugging, (continued)
- [Commit-gnuradio] [gnuradio] 08/148: Removed omnithreads dependency from libusrp2, still debugging, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 18/148: Added a callback into the channel ring enqueue and dequeue. This will allow the deqeue caller to make an arbitrary call when its done with the data. Currently, the enqueue caller makes this callback a release_frames., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 15/148: virtual destructor and shared ptr for transport, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 28/148: Cleaned up the parse ethernet stuff. Made an official max_buffs method for the transport., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 20/148: Created sbuff class to house chunks of memory, their length, and possible callback for freeing/cleanup. Switched ring and transport to make use of the sbuff on receive., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 37/148: Fixes usrp2 firmware configure with mb-gcc on ubuntu 9.10/autoconf 2.64. Disables the regression test for fopen since stdio is non-functional., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 22/148: usrp2 impl working with data transport. not up to full potential yet, but working. needs major cleanup., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 23/148: Changed the transport to return a vector of sbuffs. This way the ethernet can pass up as many buffs as ready., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 11/148: some house keeping while trying to fix thread exception, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 12/148: Disable interruption in those functions that use interruption points such as sleep, wait, and timed_wait., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 30/148: being more c++y with the ring,
git <=
- [Commit-gnuradio] [gnuradio] 36/148: Merge branch 'vita_rx' of http://gnuradio.org/git/matt into wip/usrp2, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 29/148: cleanup stuff, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 31/148: pass vector of sbuffs by reference to callback, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 41/148: be a little more PC about it, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 32/148: Merge branch 'vita_rx' of http://gnuradio.org/git/matt into wip/usrp2, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 27/148: new memory map for vita49. Apps won't compile, since symbol names are different, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 16/148: Put ethernet control transport into its own cc/h files. Ethernet control transport is in-charge of ethernet and transport headers, so that usrp2 impl knows nothing about ethernet stuff (as far as control goes)., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 24/148: vita rx instead of rx_control. Ready for firmware testing. Misses timing by a little bit, will worry later., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 33/148: got firmware compiling with vrt rx, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 34/148: forgot to declare wires, git, 2016/08/14