Comments (17)
Thanks for reporting!
I'm assuming this is GCC?
Which version is this on?
from hfsm.
NP! Yes gcc. I've been scouring the code to see if I can figure it out, but so far to no avail. Here's the gcc version:
$ gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.5) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
from hfsm.
Interestingly, I've got no issues with Visual Studio 2017.
Will have to look at this over the weekend.
Out of curiosity - how did you find this repo?
Are you trying to use it in your own project?
from hfsm.
Thanks!
I found it by searching "finite state machine language:c++" on github. This is like the 3rd repo that comes up, and it looks to be the most useful for my use-case :)
from hfsm.
:)
What kind of app are you building with it?
from hfsm.
I work for a startup called area17 that does robotics. I need a simple state machine for handling a node state (starting, running, stopping, idle, etc.). We also have 3 or 4 other places in or code where state machines are implemented (sadly) as nested switch statements, and I don't want to repeat that mistake ;)
Was about to start writing my own when I came across this.
from hfsm.
Nice. Nested switch statements is the very reason I made HFSM in the first place :)
Even thought it was originally made for games, it should suit embedded well since it doesn't allocate any memory dynamically.
from hfsm.
Interestingly, this assert seems to be Linux specific.
I'm normally on windows, and all of the Visual Studio, GCC and Clang work perfectly fine.
I'll try reproducing it on a Linux VM.
from hfsm.
I also just tested it on aarch64 (an Nvidia TX1) running Ubuntu 16.04, and the tests pass!
So it appears to be specific to Linux on x86_64.
from hfsm.
I wonder if it has something to do with the use of #pragma pack
? Just a guess. I've never used that particular pattern before.
from hfsm.
Might be! Could you try commenting out those?
I've added them only to save memory, they shouldn't affect the logic at all.
from hfsm.
If I comment them out, I get a different exception:
hfsm_test: ../test/../hfsm/detail/array.hpp:31: hfsm::detail::Array<T, TCapacity>::Array() [with T = hfsm::M<Context, 4u>::Transition; unsigned int TCapacity = 6u]: Assertion `&View::get(0) == _storage' failed.
from hfsm.
I spent some time digging into that, and for the life of me don't understand why commenting out the #pragma pack
logic should break that.
from hfsm.
It changes memory layout.
I'm using some hacky reinterpret_cast<>()
-style memory management.. :)
from hfsm.
Ewwwwww lol. I looked at it though and couldn't immediately come up with a different way without making big changes
from hfsm.
Fixed it!
from hfsm.
Nice! I pulled HEAD and verified that it works on Linux x86_64.
Also, I sent out this PR a couple days ago. Would appreciate if you would merge (if you think it makes sense). I basically just implemented the stuff in your CMakeLists.txt that is needed to use this project from other cmake projects (i.e. my project).
from hfsm.
Related Issues (12)
- Update documentation to remove Time HOT 1
- Can't use it on the x86 platform HOT 1
- More Complete Examples HOT 6
- More Documentation HOT 6
- Single-File Release version of header? HOT 6
- Compile Error with Logging Enabled HOT 2
- Question about substitute() method HOT 5
- wideForwardRequest fails to build in release mode HOT 1
- Add ability to save current state as .dot file (or similar) HOT 1
- Support passing action data to States HOT 11
- Exception handling from react() methods HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hfsm.