
Does anyone know of any weird behavior from allocators in VC 8.0? The Function library uses allocators when available, but the two tests of allocators (allocator_test and function_test) are failing on VC 8.0 (but not 7.1). From the config info, I see that BOOST_HAS_PARTIAL_STD_ALLOCATOR is defined but BOOST_NO_STD_ALLOCATOR is not (boost::function uses the latter). The actual failure is here: http://tinyurl.com/dq3lh Could someone with access to VC 8.0 (beta 2, I guess) check to see what is happening here? Doug

On 5/9/05, Doug Gregor <dgregor@cs.indiana.edu> wrote:
The actual failure is here: http://tinyurl.com/dq3lh Could someone with access to VC 8.0 (beta 2, I guess) check to see what is happening here?
Some quick tests with debugging print statements in function_test shows: * counting_allocator isn't even being instantiated * counting_allocator::allocate / deallocate not being invoked (which would follow from the first point). Not sure of the WHY, but this is some WHAT. -- Caleb Epstein caleb dot epstein at gmail dot com

Does anyone know of any weird behavior from allocators in VC 8.0? The Function library uses allocators when available, but the two tests of allocators (allocator_test and function_test) are failing on VC 8.0 (but not 7.1). From the config info, I see that BOOST_HAS_PARTIAL_STD_ALLOCATOR is defined but BOOST_NO_STD_ALLOCATOR is not (boost::function uses the latter).
The actual failure is here: http://tinyurl.com/dq3lh Could someone with access to VC 8.0 (beta 2, I guess) check to see what is happening here?
It's the first fallout from the recent type_traits changes, but it's a bug in the test case that's being exposed: Boost::function doesn't allocate any storage if the function object is stateless, and VC8 is now the first compiler to automatically detect stateless user-defined types via is_stateless, so Boost.Function assignment goes via: template<typename FunctionObj> void assign_to(FunctionObj, detail::function::stateless_function_obj_tag) which doesn't use an allocator at all, hence the failed tests. I think the solution is to fix the tests to use function objects that do have state. HTH, John.

On May 10, 2005, at 6:29 AM, John Maddock wrote:
Does anyone know of any weird behavior from allocators in VC 8.0? The Function library uses allocators when available, but the two tests of allocators (allocator_test and function_test) are failing on VC 8.0 (but not 7.1). From the config info, I see that BOOST_HAS_PARTIAL_STD_ALLOCATOR is defined but BOOST_NO_STD_ALLOCATOR is not (boost::function uses the latter).
The actual failure is here: http://tinyurl.com/dq3lh Could someone with access to VC 8.0 (beta 2, I guess) check to see what is happening here?
It's the first fallout from the recent type_traits changes, but it's a bug in the test case that's being exposed:
Boost::function doesn't allocate any storage if the function object is stateless, and VC8 is now the first compiler to automatically detect stateless user-defined types via is_stateless, so Boost.Function assignment goes via:
template<typename FunctionObj> void assign_to(FunctionObj, detail::function::stateless_function_obj_tag)
which doesn't use an allocator at all, hence the failed tests.
Amazing! Thank you for tracking this down.
I think the solution is to fix the tests to use function objects that do have state.
Will do! Doug
participants (4)
-
Caleb Epstein
-
Doug Gregor
-
Douglas Gregor
-
John Maddock