[MERGED] libosmocore[master]: bitvec: Force inlining of bitvec_set_bit_pos/bitvec_set_bit

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Sat Jul 16 21:02:42 UTC 2016


Harald Welte has submitted this change and it was merged.

Change subject: bitvec: Force inlining of bitvec_set_bit_pos/bitvec_set_bit
......................................................................


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
---
M src/bitvec.c
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Max: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/bitvec.c b/src/bitvec.c
index ef8fd0e..38148ac 100644
--- a/src/bitvec.c
+++ b/src/bitvec.c
@@ -143,7 +143,7 @@
  *  \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 @@
  *  \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;
 

-- 
To view, visit https://gerrit.osmocom.org/535
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0b6b90610f4c17f02e4efa064c3bf1ac2dccb22a
Gerrit-PatchSet: 2
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Holger Freyther <holger at freyther.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msuraev at sysmocom.de>



More information about the gerrit-log mailing list