summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Müller <mueller@kit.edu>2018-02-20 13:22:42 +0100
committerMarcus Müller <marcus@hostalia.de>2018-02-23 19:06:50 +0100
commite3f34354bd7d29b19f456493c3418ff58527c708 (patch)
treec423166282e4c36782d8ba3bcb59e55f92f59caf
parent9a366d9412e7f387cf325d6046806ed97497aa27 (diff)
digital: call delete_head_nowait with precomputed pmt::intern key
Instead of going through the pmt::intern dance every time the queue is checked.
-rw-r--r--gr-digital/lib/hdlc_framer_pb_impl.cc7
-rw-r--r--gr-digital/lib/hdlc_framer_pb_impl.h2
2 files changed, 6 insertions, 3 deletions
diff --git a/gr-digital/lib/hdlc_framer_pb_impl.cc b/gr-digital/lib/hdlc_framer_pb_impl.cc
index 3722ee599f..f268d64a55 100644
--- a/gr-digital/lib/hdlc_framer_pb_impl.cc
+++ b/gr-digital/lib/hdlc_framer_pb_impl.cc
@@ -45,9 +45,10 @@ namespace gr {
hdlc_framer_pb_impl::hdlc_framer_pb_impl(const std::string frame_tag_name)
: gr::sync_block("hdlc_framer_pb",
gr::io_signature::make(0, 0, 0),
- gr::io_signature::make(1, 1, sizeof(unsigned char)))
+ gr::io_signature::make(1, 1, sizeof(unsigned char))),
+ d_port(pmt::mp("in"))
{
- message_port_register_in(pmt::mp("in"));
+ message_port_register_in(d_port);
d_frame_tag = pmt::string_to_symbol(frame_tag_name);
std::stringstream str;
str << name() << unique_id();
@@ -129,7 +130,7 @@ namespace gr {
}
//get PDU
- pmt::pmt_t msg(delete_head_nowait(pmt::mp("in")));
+ pmt::pmt_t msg(delete_head_nowait(d_port));
if(msg.get() == NULL) return oidx;
pmt::pmt_t len(pmt::car(msg)); //TODO for non-mult-8 nbits
diff --git a/gr-digital/lib/hdlc_framer_pb_impl.h b/gr-digital/lib/hdlc_framer_pb_impl.h
index 90d51a96e6..074c23a2e6 100644
--- a/gr-digital/lib/hdlc_framer_pb_impl.h
+++ b/gr-digital/lib/hdlc_framer_pb_impl.h
@@ -38,6 +38,8 @@ namespace gr {
std::vector<unsigned char> unpack(std::vector<unsigned char> &pkt);
void stuff(std::vector<unsigned char> &pkt);
+ const pmt::pmt_t d_port;
+
public:
hdlc_framer_pb_impl(const std::string frame_tag_name);
~hdlc_framer_pb_impl();