Subject: [Boost-bugs] [Boost C++ Libraries] #4803: [function][patch] use a static "empty" target
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-10-29 19:38:22
#4803: [function][patch] use a static "empty" target
------------------------------+---------------------------------------------
Reporter: djwalker | Owner: dgregor
Type: Feature Requests | Status: new
Milestone: To Be Determined | Component: function
Version: Boost 1.44.0 | Severity: Optimization
Keywords: |
------------------------------+---------------------------------------------
boost::function throws bad_function_call if invoked when empty. Currently,
this is implemented by performing a pointer comparison at runtime.
Alternatively, boost::function's empty state could be represented by a
static vtable object targeting an "empty" function which throws
bad_function_call when invoked. There has been a lot of interest in this
alternative scheme, which would trade the time overhead of a pointer
comparison for an increase in space overhead in the initialized static
variable section of the executable's data segment. The degree to which
this trade-off will improve performance depends on compiler optimization.
The attached patch implements a configuration macro,
BOOST_FUNCTION_USE_STATIC_EMPTY, which allows the user to make this trade-
off. The patch includes updated documentation and tests. I verified that
the updated test suite passes on gcc 4.2, 4.5 and msvc 7.1, 10.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/4803> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:04 UTC