Commit ef2774e4 authored by Chad Austin's avatar Chad Austin Committed by Facebook Github Bot

clarify when CachelinePadded is appropriate

Summary:
dschatzberg and I used `folly::CachelinePadded` when
`alignas(folly::hardware_destructive_interference_size)` would have
sufficed.

Add a comment clarifying when CachelinePadded is appropriate.

Reviewed By: yfeldblum

Differential Revision: D12970571

fbshipit-source-id: 7d9193358a7b1aec78c95b715641396474eaebcf
parent cd31e875
......@@ -29,6 +29,9 @@ namespace folly {
*
* If `sizeof(T) <= alignof(T)` then the inner `T` will be entirely within one
* false sharing range (AKA cache line).
*
* CachelinePadded may add padding both before and after the value. Consider
* whether alignas(folly::hardware_destructive_interference_size) suffices.
*/
template <typename T>
class CachelinePadded {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment