-
Notifications
You must be signed in to change notification settings - Fork 401
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
buffer: Add realign() member function
This function is used to realign the buffer so that the data starts at a given offest from the beginning of the buffer. This is useful when a struct is streamed into the buffer but it is not aligned to the proper memory boundary. Might also be useful for other use cases. ConstBufferType::realign() is a const member function that does a similar thing but since ConstBufferType doesn't own its buffer it can't grow if this is required. This overload of realign() will grow the buffer if that is needed, and if not it calls the const version of realign(). Unit tests included. Signed-off-by: Charlie Vigue <[email protected]>
- Loading branch information
Showing
2 changed files
with
88 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters