Boost logo

Boost :

From: John Maddock (John_Maddock_at_[hidden])
Date: 2001-11-30 07:34:08


>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 :)

STLports allocator under VC6 isn't standard conforming - so workarounds are
in place - possibly I should rewrite these to use SGI's base allocator
though... now done; see <boost/detail/allocator.hpp>

>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?

Doesn't work, there are VC6 compiler problems, even if you define an
allocator that conforms to the standard.

>3. If I try to
>
> typedef boost::match_results<const wchar_t* ,std::allocator< wchar_t >
> match;
>
>I get errors:

base_type is part of the "work around" interface in
<boost/detail/allocator.hpp>, it's required because the compiler doesn't
support a "rebind template" style interface.

- John Maddock
http://ourworld.compuserve.com/homepages/john_maddock/


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