-
-
Notifications
You must be signed in to change notification settings - Fork 65
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
AML: Suggestion - Use smart pointer instead of [u8] #173
Comments
I definitely agree this could be improved. In the past, I've got pretty far with just printing the next dozen or so bytes and seeing what isn't parsing, but it would be nicer to have more context. I'm also guessing that this would be an iteration of the solution you've suggested in #169? If so I think doing it by tracking the offset through the slice as we go will be a more accurate solution. I don't think we need a smart pointer, as fundamentally we will be operating on a Edit: although I've just had a look at our current parser code and I agree this looks simplest to do, because of the way we return |
I have an implementation with this:
There was a lot of copy/paste and removal of &'s to make it work, but it seems to work fine. However, I think I will change The content of functions is copied into a Vec, I convert the Vec into an AmlStream at the time the function gets executed. My IDE is complaining that I need an implementation of PartialEq for I hope to submit a PR this week. |
It's very difficult to debug AML code and the AML parser due to lack of information about where an error occurs. I suggest using smart pointers instead of [u8] for the buffer type, and reporting the relative position of the cursor when an error occurs. This will allow the developer to find the offending byte much more easily.
The text was updated successfully, but these errors were encountered: