2013/2/26 RaRi:
> My system environment is configured as follows:
>
> Operating system : Windows 7 64-Bit
> MinGW32,
> gcc v.4.72
You are using 32-bit mingw or 64-bit?
Please show the output of 'g++ -v'
--
Regards,
niXman
Dual-target(32 & 64-bit) MinGW compilers for 32 and 64-bit Windows:
http://sourceforge.net/projects/mingwbuilds/
Another online IDE: http://liveworkspace.org/
I will investigate, how I can simplify my state machine and reduce the
number of events.
Damn, I spent 1 month on that machine and now I have to change it...
On linux there is no problem with that. Okay, the memory exceeds 1 GB while
compiling my boost.msm based library. But it works fine!
The problem what remains is to compile the stuff for windows.
I have already just test one thing: Cross-compilation of my boost.Msm state
machine on linux for windows with mingw32msvc-g++. But already doing this
produced some errors:
*../src/TransportLayer/Statemachine/Master/CStateMasterHandshaking.hpp:33:
error: class ‘CStateMasterHandshaking_’ does not have any field named
‘BaseStateMachineFrontEnd’
../src/TransportLayer/Statemachine/Master/CStateMasterHandshaking.hpp:33:
error: no matching function for call to
‘BaseStateMachineFrontEnd<CStateMasterHandshaking_>::BaseStateMachineFrontEnd()’
../src/TransportLayer/Statemachine/Master/../Common/BaseStateMachineFrontEnd.hpp:48:
note: candidates are:
BaseStateMachineFrontEnd<TYPE>::BaseStateMachineFrontEnd(EventQueue&) [with
TYPE = CStateMasterHandshaking_]
../src/TransportLayer/Statemachine/Master/../Common/BaseStateMachineFrontEnd.hpp:26:
note:
BaseStateMachineFrontEnd<CStateMasterHandshaking_>::BaseStateMachineFrontEnd(const
BaseStateMachineFrontEnd<CStateMasterHandshaking_>&)*
I think, the MSVC-specific cross compiler is responsible for this error.
I don't now, how to continue with this problem. At the worst I have to
change the state machine completely.....
Thanks so far,
Rafael
--
View this message in context: http://boost.2283326.n4.nabble.com/Boost-MSM-cc1plus-exe-error-out-of-memory-allocating-65532-tp4643468p4643543.html
Sent from the Boost - Users mailing list archive at Nabble.com.
Hi,
not sure how to help you there without code, but from what I see, I'd say
that BaseStateMachineFrontEnd has a ctor which hides the default-ctor. Try
to provide one and see if that helps.
I don't think you have to change it completely. Probably replacing a bunch
of events by a single one containing an id as attribute, then checking it in
a guard to see what event you really posted would probably be enough.
Cheers,
Christophe
FYI: my library that uses the boost.msm-based state machine mechanism shall
be released as shared library. It is used to realize Remote Procedure Calls.
So my library consists of one Master state machine (which consists of 5
submachines and together 21 states) and one Slave state machine (which
consists of 4 submachines and 19 states). The user application linking
against my library has the possibility to choose if the slave state machine
or the master state machine part shall be used. Now the problem could be,
that I use a boost::variant type to store the 44 different application event
types. This variant type I pass to the process_event method of each state
machine (master and slave) although the slave state machine doesn't support
the same event types like the master and vice-versa. This produces
unnecessary template invocations and memory allocation.
So the solution could be, to split my single shared library into two shared
libraries: one for the master and one for the slave logic and each of it has
a reduced boost::variant type( just with the event types of the concrete
state machine).
Or I keep the solution with the single shared library and I split the
single boost::variant type into two different ones: one for the master and
one for the slave state machine. And each boost::variant type will just be
forwarded to the appropriate process_event method of the corresponding state
machine. Doing so, will also prevent unnecessary template invocations for
each event type on the corresponding state machine. Maybe this will also
reduce the memory consumption...
What is your opinion about this two putative solutions?
Best regards (viele grüsse),
Rafael
--
View this message in context: http://boost.2283326.n4.nabble.com/Boost-MSM-cc1plus-exe-error-out-of-memory-allocating-65532-tp4643468p4643554.html
Sent from the Boost - Users mailing list archive at Nabble.com.
> FYI: my library that uses the boost.msm-based state machine mechanism
> shall
> be released as shared library. It is used to realize Remote Procedure
> Calls.
> So my library consists of one Master state machine (which consists of 5
> submachines and together 21 states) and one Slave state machine (which
> consists of 4 submachines and 19 states). The user application linking
> against my library has the possibility to choose if the slave state
> machine
> or the master state machine part shall be used. Now the problem could be,
> that I use a boost::variant type to store the 44 different application
> event
> types. This variant type I pass to the process_event method of each state
> machine (master and slave) although the slave state machine doesn't
> support
> the same event types like the master and vice-versa. This produces
> unnecessary template invocations and memory allocation.
Yes, every process_event with a different event type costs template
instantiations, and process_event is the most expensive part.
> So the solution could be, to split my single shared library into two
> shared
> libraries: one for the master and one for the slave logic and each of it
> has
> a reduced boost::variant type( just with the event types of the concrete
> state machine).
Sounds logical. Though I don't get it with the variant. Are you doing type
switching with boost::get?
You could also do 1 library with 2 different classes, each implemented with
one different fsm. Maybe some states or actions can be reused, though it
doesn't improve your compile-time.
In any case, 2 TUs are nicer to the compiler than 1 big one, yes.
I will also take the chance to advertise type_erasure (see a previous post
on this list) as a good replacement of boost::variant.
> Or I keep the solution with the single shared library and I split the
> single boost::variant type into two different ones: one for the master and
> one for the slave state machine. And each boost::variant type will just be
> forwarded to the appropriate process_event method of the corresponding
> state
> machine. Doing so, will also prevent unnecessary template invocations for
> each event type on the corresponding state machine. Maybe this will also
> reduce the memory consumption...
If your variant "knows" less types and thus provokes less different
process_event instantiations within one TU, yes.
> What is your opinion about this two putative solutions?
I suppose it depends on your use case. I personally tend to build several
smaller state machines. I find them easier to understand and more likely to
be reused.
Sometimes I go as far as hiding each fsm in the cpp of a different class.
Then I make sure each class follows a given, small interface.
This way, they are easier to exchange with others or to combine. Sure I lose
the tight coupling of submachines, but I don't think I make a bad deal.
But again, this is a matter of taste and of your personal use case.
> Best regards (viele grüsse),
>
> Rafael
Viele Grüße,
Christophe
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
If you reply to this email, your message will be added to the discussion below:http://boost.2283326.n4.nabble.com/Boost-MSM-cc1plus-exe-error-out-of-memory-allocating-65532-tp4643468p4643611.html