Boost logo

Boost Users :

From: Andreas Huber (ahd6974-spamboostorgtrap_at_[hidden])
Date: 2008-04-19 11:28:40


Hi

> If I specified boost::fast_pool_allocator<int> does the library take care
> of somehow doing a rebind and allocating the right amount of memory for
> the states ?

Yes, please see:

<http://www.boost.org/doc/libs/1_35_0/libs/statechart/doc/faq.html#HardRealtime>
<http://www.boost.org/doc/libs/1_35_0/libs/statechart/doc/reference.html#ClassTemplatestate_machine>,
Allocator parameter
<http://www.boost.org/doc/libs/1_35_0/libs/statechart/doc/reference.html#ClassTemplateevent>,
Allocator parameter

[snip]
> struct Enabled;
> struct Machine : sc::state_machine< Machine,
> Enabled,
> boost::fast_pool_allocator< int > > /* ??? is this
> right ? */
> {
> Machine();
> ~Machine() {
> terminate();
> }
> int ContextAssociatedwithStateMachine;
> };

Looks good to me. boost::fast_pool_allocator< int > is used in the
performance example here:

<http://www.boost.org/doc/libs/1_35_0/libs/statechart/example/Performance/Performance.cpp>

HTH & Regards,

-- 
Andreas Huber
When replying by private email, please remove the words spam and trap
from the address shown in the header. 

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