[ovs-dev] [RFC PATCH 2/4] lib/ofpbuf: Inline the trivial ofpbuf functions.

Ben Pfaff blp at nicira.com
Mon Mar 24 20:57:53 UTC 2014


On Mon, Mar 24, 2014 at 10:59:04AM -0700, Jarno Rajahalme wrote:
> Inline the most trivial ofpbuf functions to allow for better optimization.
> Also inline the most often used ofpbuf_pull() and ofpbuf_try_pull(), which
> should help streamline packet parsing.
> 
> Signed-off-by: Jarno Rajahalme <jrajahalme at nicira.com>

For inlining, I usually lean toward leaving the prototypes in their
places (you do have to add "static inline" to each one) and then
putting the implementation near the end of the header file.  That way,
it's easy to get an idea of the API at a glance without having the
code cluttered with the implementation details.

Acked-by: Ben Pfaff <blp at nicira.com>



More information about the dev mailing list