Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmap: Use PADDED_MEMBERS macro for cmap_bucket padding.
Current implementation of manual padding inside struct cmap_bucket doesn't work for some cacheline sizes. For example, if CACHE_LINE_SIZE equals to 128, compiler adds an additional 8 bytes: 4 bytes between 'hashes' and 'nodes' and 4 bytes after the manual 'pad'. This leads to build time assertion, because sizeof(struct cmap_bucket) == 136. Fix that by using PADDED_MEMBERS macro, which will handle all the unexpected compiler paddings. This is safe because we still have build time assert for the structure size. Other possible solution is to pack the structure, but the padding marco looks better and matches the other code. Signed-off-by: Ilya Maximets <[email protected]> Signed-off-by: Ben Pfaff <[email protected]>
- Loading branch information