Boost logo

Boost Users :

Subject: [Boost-users] [boost.any] Inline allocation of small objects in any.
From: Adarsh Soodan (adarshsoodan_at_[hidden])
Date: 2011-02-08 21:15:41


Hi,

The frequent heap usage of boost::any was problematic to me for small object
sizes. So I made a small tweak in boost::any which provides inline
allocation of objects smaller than a certain template defined size. It
practically eliminated the performance overhead of heap allocation and
deallocation in my project while providing all benefits of boost::any.

You can see the changed file at
http://gitorious.org/athi/athi/blobs/master/core/any.hpp

It is not cleaned up, but I thought it worthwhile to have any comments from
somebody who solved the same problem.

Thanks,
Adarsh



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