Boost logo

Boost :

From: Carl Daniel (cpdaniel_at_[hidden])
Date: 2001-11-27 13:10:00


I'm attempting to follow up on a recent (brief) discussion about performance issues with boost::match_results and the
default allocator.

I too have an application where I'm seeing less than stellar performance and I'm suspicious of regex. A couple of
things puzzle me:

1. I'm using VC6 with STLPort 4.5. Am I correct in believing that the standard allocator (std::allocator) should be
using the SGI node-based allocator by default? (I realize that's more of an STLPort question, but I'm here :)

2. Digging into boost::regex_search, I see that match_results isn't even using std::allocator, despite the claim that
that's the default allocator. Instead, it's using a boost::re_detail::simple_allocator (or something like that) which
simply uses ::operator new(). What is preventing boost::regex from using std::allocator?

3. If I try to

    typedef boost::match_results<const wchar_t* ,std::allocator< wchar_t > > match;

I get errors:

c:\carl\cbb\dev\boost_1_25_1\boost\detail\allocator.hpp(229) : error C2039: 'base_type' : is not a member of
'allocator<unsigned short>'
        c:\carl\cbb\dev\boost_1_25_1\boost\regex.hpp(850) : see reference to class template instantiation
'boost::detail::rebind_allocator<unsigned short const *,class _STL::allocator<unsigned short> >' being compiled
        c:\carl\cbb\dev\boost_1_25_1\boost\regex.hpp(1346) : see reference to class template instantiation
'boost::re_detail::match_results_base<unsigned short const *,class _STL::allocator<unsigned short> >' being compiled
        c:\carl\cbb\dev\cbbcom\htmlconverter.h(737) : see reference to class template instantiation
'boost::match_results<unsigned short const *,class _STL::allocator<unsigned short> >' being compiled

And it would seem rightly so - there's no base_type member in std::allocator.

Any hints would be appreciated.

-cd


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk