Boost logo

Boost Users :

Subject: [Boost-users] [bind/function] memory allocation question
From: Tim Blechmann (tim_at_[hidden])
Date: 2009-09-24 09:04:01


hi all,

i would like to use boost.bind and boost.function in a real-time
application, where heap memory allocation is not allowed.
according to the docs, boost.function may allocate memory on the heap,
but uses a small object optimization, to avoid heap allocation.

i'd be curious, if there is a way to figure out, whether heap allocation
may occur or not ... i would like to be able to use boost::function
objects, initialized by boost::bind, something like:

void callme (int some, int args)
{}

boost::function<void (void)> fn = boost::bind(callme, 1, 2);
fn();

thanks, tim

-- 
tim_at_[hidden]
http://tim.klingt.org
Which is more musical, a truck passing by a factory or a truck passing
by a music school?
  John Cage



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