-
Notifications
You must be signed in to change notification settings - Fork 516
Abstract FirmataParser memory allocation scheme #332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
3bd356d
to
12b63ec
Compare
I think we definitely need unit tests for the Parser to ensure all expected cases are covered. The test suit should also ensure there are no memory leaks. |
This pull request relieves FirmataParser of the ownership of buffer. As a result, the parser can not cause a memory leak. Currently, I am in the middle of my prototype, and I don't have time to write any test. I was hoping to be able to complete my prototype without forking your repo. If we can run this through your board tests this weekend and pull it in, I won't send you another change to the parser without first writing some tests. |
Ok I will run it through my board tests tomorrow. |
I get a compiler warning when compiling for the following boards (some compilers are more picky than others):
|
I get a compiler error when compiling for an Arduino Uno, Mega and Teensy 2.0 (all AVR boards) in Arduino 1.0.6:
|
Other than the above mentioned compiler error and compiler warning, I don't see any issues when running on hardware. |
@soundanalogous I just got home, and I'll have those cleared up in a moment. |
@soundanalogous Okay it should be all clear now. I have confirmed the update by talking from Arduino to Linux using the same exact code! 😄 |
Looks good. All tests are passing. Thanks again! |
This is ready for testing. I haven't had any opportunity to test this between hardware, but it does pass the test suite.
I wanted to share what I'm working on, so I could get feedback. I think it resolves the memory allocation concerns @soundanalogous pointed out in issue #328, and it can also handle my desire to utilize
realloc()
.I will report back once I've had an opportunity to test.
[EDIT] I have confirmed it works with Windows Remote Arduino.
[EDIT] I have confirmed it works as expected on Linux.