Port fbstring_core to big-endian architectures.
authorChristopher Cole <colec@amazon.com>
Mon, 14 Sep 2015 17:47:12 +0000 (10:47 -0700)
committerfacebook-github-bot-4 <folly-bot@fb.com>
Mon, 14 Sep 2015 18:20:25 +0000 (11:20 -0700)
commit6c2044f2a6d364f6c3c6632e92251548749aa5f7
tree951d6e3e708ba3106847f499e2842676d75f7278
parent020e1260daf42445e30f84fe81fc7eafde5fb7b0
Port fbstring_core to big-endian architectures.

Summary: There's 2 ways this could be implemented - either as a series of preprocessor blocks depending on target architecture (as I have implemented it here), or by encapsulating access to MediumLarge::capacity_ within getters/setters as in a similar manner to setSmallSize() and smallSize(). The first option makes the code a bit harder to read, but the second option changes the existing control flow a bit which could slightly alter performance.

I opted for the first so as to keep the existing amd64 flow untouched, but can easily change the pull request to the second option to keep code readability a priority.
Closes https://github.com/facebook/folly/pull/244

Reviewed By: @Gownta

Differential Revision: D2306568

Pulled By: @JoelMarcey
folly/FBString.h
folly/docs/FBString.md