Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
btl/sm: rewrite of fast box (per-peer receive buffers)
I was investigating possibly lost btl/sm messages and realized that the code is difficult to follow and it is not always clear what I was attempting to do. It is not clear if there is a problem but the rewrite is worth committing. This change does the following: - Seperate the fast box metadata out from the fast box receive data. These parts are logically separate so there was no need to keep adjusting the offset based on the metadata (start of buffer was offset 64, now 0). - Use modulo-math instead of toggling an extra bit to determine full vs empty. To keep this fast the modulo is done with bitwise-and with a mask and the fast box size has been limited to a power of two. This change simplifies the math and only has one special case to cover ( end overflow-- end less than start). - General cleanup of the code overall to improve readability. Signed-off-by: Nathan Hjelm <hjelmn@google.com>
- Loading branch information