Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #641 and closes #645.
For pointer alignment,
buffer_offset
must be a multiple of 4. If it is not, the program will panic like in #641 and #645. This PR roundsbuffer_offset
up to the nearest multiple of 4 to avoid this issue. This also requires increasing the size of the buffer to ensure there is enough room to read into. I have madebuffer_offset
a member ofDataLinkReceiverImpl
as the allocation and use of the read buffer both require it, and previously it was derived twice in these two locations. By making it a member, it only needs to be derived once.This is pretty hacky code. As the FIXME in the file indicates, there are much better ways of getting around this. I think this would require breaking API changes however, and I am not familiar with the codebase. For now I think this hotfix is sufficient.