[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

JavaHL: function inlining

From: Hyrum K. Wright <hyrum_wright_at_mail.utexas.edu>
Date: 2007-04-19 19:02:03 CEST

There are several small and frequently called functions in the JavaHL
C++ classes which could be inlined by the compiler. (One example is the
Pool::pool() function.) By having the compiler inline such functions,
overhead is eliminated, and other optimizations possibly performed. C++
provides the "inline" keyword to allow us to suggest that the compiler
inline these functions. (Actual inlining is up to the compiler, but
most compilers worth their salt will inline these types of functions
regardless of the "inline" keyword.)

The catch here is that the function implementation must be moved to the
header file, so that it is available to each source file upon
compilation. The function definition now becomes part of the interface,
and code compiled against different versions of the function are now no
longer binarily compatible. Because we make no compatibility guarantees
within JavaHL itself, I don't see this as a problem.

Thoughts?

-Hyrum

Received on Thu Apr 19 19:02:18 2007

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.