folly/PaddedSequence.h
authorTudor Bosman <tudorb@fb.com>
Mon, 3 Dec 2012 20:54:57 +0000 (12:54 -0800)
committerJordan DeLong <jdelong@fb.com>
Sun, 16 Dec 2012 22:46:24 +0000 (14:46 -0800)
commit95ad385e0055b5d324ced22dea04b58fff7eb15d
treeab4f59cfcd01af011ea0586db8dfb3961b8df10b
parentd12f21b0e8ba4d833cbea8479a44800cfb479c20
folly/PaddedSequence.h

Summary:
Code that aids in storing data aligned on block (possibly cache-line)
boundaries, perhaps with padding. There's class Node which represents one
block, and Iterator which, given an iterator to a container of Nodes, gives you
an iterator to the underlying elements.  There's also Adaptor, which converts a
sequence of Node into a sequence of underlying elements. (with enough
functionality to make it useful, although it's not fully STL compatible)

Split off from https://phabricator.fb.com/D641114

Also includes changes to make TypedIOBuf container-like so it can be used with padded_sequence::Adaptor.

I plan to rename this to Padded.h / folly::padded in a separate diff.

Test Plan: test added

Reviewed By: soren@fb.com

FB internal diff: D646249
folly/Portability.h
folly/SmallLocks.h
folly/experimental/io/TypedIOBuf.h