summaryrefslogtreecommitdiff
path: root/gr-digital/lib/header_payload_demux_impl.cc
diff options
context:
space:
mode:
authorMarcus Müller <mueller@kit.edu>2018-02-20 11:22:14 +0100
committerMarcus Müller <marcus@hostalia.de>2018-02-23 19:06:50 +0100
commit97f0d1cecf4a8cb82e8e16e4dfcac0589c5b56c7 (patch)
treee0ad2aba49c4ebcb8a8bbf9f6b65bc8a953c95e0 /gr-digital/lib/header_payload_demux_impl.cc
parent2fc414578985b59c5bfbb15103f3c3677a1c6fdc (diff)
blocks: remove unnecessary call to pmt::intern at runtime
typical usage: message_port_pub(pmt::mp("out_port"), …) which is bad, as it implies hashing of a string, allocation of memory, deallocation, finding the hashed string in the table of interned strings and returning a unique pointer (which for reasons of PMT awesomeness isn't even unique) to the interned port name. Replacing all these port name ad hoc ::mp() calls by reusing one, private, port name member.
Diffstat (limited to 'gr-digital/lib/header_payload_demux_impl.cc')
-rw-r--r--gr-digital/lib/header_payload_demux_impl.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/gr-digital/lib/header_payload_demux_impl.cc b/gr-digital/lib/header_payload_demux_impl.cc
index be9e2bf591..646902d506 100644
--- a/gr-digital/lib/header_payload_demux_impl.cc
+++ b/gr-digital/lib/header_payload_demux_impl.cc
@@ -31,6 +31,8 @@
namespace gr {
namespace digital {
+ const pmt::pmt_t header_payload_demux_impl::s_msg_port_id = pmt::mp("header_data");
+
//! Returns a PMT time tuple (uint seconds, double fraction) as the sum of
// another PMT time tuple and a time diff in seconds.
pmt::pmt_t _update_pmt_time(
@@ -60,8 +62,6 @@ namespace gr {
PORT_TRIGGER = 1
};
-#define msg_port_id pmt::mp("header_data")
-
header_payload_demux::sptr
header_payload_demux::make(
int header_len,
@@ -149,8 +149,8 @@ namespace gr {
);
}
set_tag_propagation_policy(TPP_DONT);
- message_port_register_in(msg_port_id);
- set_msg_handler(msg_port_id, boost::bind(&header_payload_demux_impl::parse_header_data_msg, this, _1));
+ message_port_register_in(s_msg_port_id);
+ set_msg_handler(s_msg_port_id, boost::bind(&header_payload_demux_impl::parse_header_data_msg, this, _1));
for (size_t i = 0; i < special_tags.size(); i++) {
d_special_tags.push_back(pmt::string_to_symbol(special_tags[i]));
d_special_tags_last_value.push_back(pmt::PMT_NIL);