Boost logo

Boost Users :

From: Anthony P (ntb2go_at_[hidden])
Date: 2006-10-05 01:00:59


> My application also
> uses a lot of strings (basic_string) and I was seeking some advice on
> changing the basic_string allocator to a “boost allocator” . Can anyone
> offer some advice in this regard?

If your allocating lots of small strings as part of processing that are
all discarded once done I would consider one of the pool allocators to
save time in destructing them all.

Alternatively, preallocate them with maximum sizes and make them static
which achieves the same effect for repeated processing using the same
set of small strings.

It depends upon your application so testing is the best approach.

regards,

Anthony


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net