Boost logo

Boost :

From: Hillel Y. Sims (hsims_at_[hidden])
Date: 2002-08-30 12:05:08


"Toon Knapen" <toon.knapen_at_[hidden]> wrote in message
news:20020830143026.407D3DBD26_at_tartarus.telenet-ops.be...
> First, every new involves a system call so if you do a lot of new's you're
> better of first allocating a memory pool (only one system call) and using
> placement new to create/destroy many small objects.
>

This is not necessarily true. Many run-time libraries (implementing
::operator new) maintain their own efficient internal memory pools to avoid
having to make system calls for every allocation request. Even the
difference in efficiency between a general-purpose allocator vs. a
customized small-object allocator is not always that relevant. Avoiding the
increased complexity inherent in using custom allocators may often outweigh
any potential performance benefits.

hys

--
Hillel Y. Sims
FactSet Research Systems
hsims AT factset.com

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