I can't override the global allocators because application code
reserves the right do that. I'm making a library. If a library
overrides new and delete, the application that links against it cannot
(multiply defined linker references will result as the error).
Often, in embedded applications, it is not safe to ever call the
global allocator -- allocations must be routed to specific heaps for
particular purposes. For example, if you have a solid state hard
drive, portions of it may be reserved to function as a heap. You want
certain pieces of memory to allocated there (where accesses are slow
and made infrequently), and certain other pieces to be allocated in
the main RAM (where accesses are frequent and fast.)
Or, as another example, if you use a library you may want to be able
to profile the memory used by it (for example to provide high-speed
pools for frequent allocation sizes, or to see how close you are to
running up against the limits of the memory available in a particular
heap). This is only really straightforward to do if the library is
provided allocators through which all its allocations are made.
- Stuart
On Tue, Jun 24, 2008 at 11:12 AM, Emil Dotchevski
On Mon, Jun 23, 2008 at 10:34 AM, Stuart Reynolds
wrote: So, for now it looks like I need to modify the the serialization library for boost and incorporate it into my build system. (Right?)
Can't you override global new/delete? This will catch all STL allocations as well as anything from Boost.
Emil Dotchevski Reverge Studios, Inc. http://www.revergestudios.com/reblog/index.php?n=ReCode _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users