From 511b448fe3a8522d645499b7d0b93b5acb1b3776 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Wed, 13 Jul 2016 12:26:10 +0200 Subject: bitvec: Force inlining of bitvec_set_bit_pos/bitvec_set_bit The PCU is using bitvec_write_field a lot but on the arm-poky-linux-gnueabi-gcc v4.8.1 the calls to set_bit and set_bit_pos are not inlined. The inlined variant has been a more quick for the PCU compressed bitmap decompression testcase. Used objdump -d to look at the bitvec_write_field before and after the change. The branch to bitvec_set_bit is gone and a inlined version has been used. Change-Id: I0b6b90610f4c17f02e4efa064c3bf1ac2dccb22a --- src/bitvec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/bitvec.c') diff --git a/src/bitvec.c b/src/bitvec.c index ef8fd0e8..38148acb 100644 --- a/src/bitvec.c +++ b/src/bitvec.c @@ -143,7 +143,7 @@ unsigned int bitvec_get_nth_set_bit(const struct bitvec *bv, unsigned int n) * \param[in] bit value to which the bit is to be set * \returns 0 on success, negative value on error */ -int bitvec_set_bit_pos(struct bitvec *bv, unsigned int bitnr, +inline int bitvec_set_bit_pos(struct bitvec *bv, unsigned int bitnr, enum bit_value bit) { unsigned int bytenum = bytenum_from_bitnum(bitnr); @@ -169,7 +169,7 @@ int bitvec_set_bit_pos(struct bitvec *bv, unsigned int bitnr, * \param[in] bit value of the bit to be set * \returns 0 on success, negative value on error */ -int bitvec_set_bit(struct bitvec *bv, enum bit_value bit) +inline int bitvec_set_bit(struct bitvec *bv, enum bit_value bit) { int rc; -- cgit v1.2.3