Commit 6c2044f2 authored by Christopher Cole's avatar Christopher Cole Committed by facebook-github-bot-4

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
parent 020e1260
This diff is collapsed.
...@@ -9,8 +9,8 @@ allocator. In particular, `fbstring` is designed to detect use of ...@@ -9,8 +9,8 @@ allocator. In particular, `fbstring` is designed to detect use of
jemalloc and cooperate with it to achieve significant improvements in jemalloc and cooperate with it to achieve significant improvements in
speed and memory usage. speed and memory usage.
`fbstring` supports x32 and x64 architectures. Porting it to big endian `fbstring` supports 32- and 64-bit and little- and big-endian
architectures would require some changes. architectures.
### Storage strategies ### Storage strategies
*** ***
...@@ -43,4 +43,4 @@ architectures would require some changes. ...@@ -43,4 +43,4 @@ architectures would require some changes.
`string::find()` for successful searches and a 1.5x speed `string::find()` for successful searches and a 1.5x speed
improvement for failed searches. improvement for failed searches.
* Offers conversions to and from `std::string`. * Offers conversions to and from `std::string`.
\ No newline at end of file
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