From 3e7284014cb04bc66ae50004267aed4e4ada2d14 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 10 Feb 2011 19:01:32 -0800 Subject: uhd: misc speedups w/ look up tables use a look up table for io type size (in the case its used in the fast-path) move the static const pred table in vrt unpacker to the global level, for some reason this was incurring a malloc (perhaps because there were 2 tables). --- host/lib/transport/gen_vrt_if_packet.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'host/lib/transport') diff --git a/host/lib/transport/gen_vrt_if_packet.py b/host/lib/transport/gen_vrt_if_packet.py index 3ba562d68..427217eb6 100755 --- a/host/lib/transport/gen_vrt_if_packet.py +++ b/host/lib/transport/gen_vrt_if_packet.py @@ -66,6 +66,8 @@ static pred_table_type get_pred_unpack_table(void){ return table; } +static const pred_table_type pred_unpack_table(get_pred_unpack_table()); + ######################################################################## #def gen_code($XE_MACRO, $suffix) ######################################################################## @@ -168,7 +170,6 @@ void vrt::if_hdr_unpack_$(suffix)( //if_packet_info.sob = bool(vrt_hdr_word & $hex(0x1 << 25)); //not implemented //if_packet_info.eob = bool(vrt_hdr_word & $hex(0x1 << 24)); //not implemented - static const pred_table_type pred_unpack_table(get_pred_unpack_table()); const pred_type pred = pred_unpack_table[pred_table_index(vrt_hdr_word)]; switch(pred){ -- cgit v1.2.3