summaryrefslogtreecommitdiff
path: root/gr-blocks/lib/probe_rate_impl.h
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-blocks/lib/probe_rate_impl.h
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-blocks/lib/probe_rate_impl.h')
-rw-r--r--gr-blocks/lib/probe_rate_impl.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/gr-blocks/lib/probe_rate_impl.h b/gr-blocks/lib/probe_rate_impl.h
index a1c69ba189..4153b336ae 100644
--- a/gr-blocks/lib/probe_rate_impl.h
+++ b/gr-blocks/lib/probe_rate_impl.h
@@ -38,6 +38,9 @@ namespace gr {
size_t d_itemsize;
void setup_rpc();
+ const pmt::pmt_t d_port;
+ const pmt::pmt_t d_dict_avg, d_dict_now;
+
public:
probe_rate_impl(size_t itemsize, double update_rate_ms, double alpha = 0.0001);
~probe_rate_impl();