- 19 Jan, 2013 10 commits
-
-
Tudor Bosman authored
Test Plan: folly/test/fbstring_test in debug mode Reviewed By: sdoroshenko@fb.com FB internal diff: D661622
-
Florent Thoumie authored
Summary: Extra '#' in there. Test Plan: fbconfig nagios/plugins && fbmake opt Reviewed By: carl.moran1@fb.com FB internal diff: D660977
-
Anton Korobeynikov authored
Summary: handle at least clang. It will be better to turn this into configure check, though. Test Plan: . Reviewed By: tudorb@fb.com FB internal diff: D660139
-
Thomas Whitton authored
Summary: Tests not compiling due to a copy and paste error in Makefile.am. Test Plan: . Reviewed By: tudorb@fb.com FB internal diff: D660138
-
Anton Korobeynikov authored
Summary: use proper type for index. Test Plan: . Reviewed By: tudorb@fb.com FB internal diff: D660142
-
Jordan DeLong authored
Summary: Using perfect forwarding here prevents the ability to create dynamic arrays. Test Plan: Added unit test case that compiles now with this. Reviewed By: tudorb@fb.com FB internal diff: D660662
-
Yang Ni authored
Summary: The current UpgradedHolder implementation may lead to a deadlock when upgrading from a reader lock, because it is blocking. A reader that has failed to set the UPGRADED bit may block the winner (upgrader) that has successfully set the UPGRADED bit, while waiting to upgrade in an infinite loop without releasing its own reader lock. The upgrader needs to wait for all reader locks to be released before it can move forward. This is the code pattern: { ReadHolder reader(lock); UpgradedHolder upgrader(std::move(reader)); WriteHolder writer(std::move(upgrader)); } To avoid this to happen, removed UpgradedHolder(ReadHolder&&) constructor and the function that impelments it unlock_shared_and_lock_upgrade. This would require a programmer explicitly release a read lock before acquiring an upgrade lock, therefore avoid the above mentioned deadlock. In addition, the current folly::RWSpinLock::try_lock_shared() implementation does not check the UPGRADED bit at all. The UPGRADED bit can be used to avoid starving writers. This diff fixed this by correctly checking the UPGRADED bit. Test Plan: Passed folly unit tests. Tested in a Facebook service that uses the folly::RWSpinLock::UpgradedHolder. Reviewed By: xliux@fb.com FB internal diff: D659875
-
Anton Korobeynikov authored
Summary: . Test Plan: . Reviewed By: soren@fb.com FB internal diff: D660143 Blame Revision:
-
Jonathan Wakely authored
Summary: I wouldn't even bother reporting this if github didn't make it so easy! Test Plan: . Reviewed By: soren@fb.com FB internal diff: D660136
-
Soren Lassen authored
Summary: Added benchmarks. Before: folly/test/RangeFindBenchmark.cpp relative time/iter iters/s ============================================================================ string length 10: FindFirstOfRange 1.36ns 733.07M FindFirstOfOffsetRange 2.15ns 464.16M ============================================================================ string length 256: FindFirstOfRange 1.36ns 733.07M FindFirstOfOffsetRange 1.42ns 704.22M ============================================================================ string length 10240: FindFirstOfRange 1.36ns 733.07M FindFirstOfOffsetRange 3.72ns 268.70M ============================================================================ string length 10485760: FindFirstOfRange 1.36ns 733.07M FindFirstOfOffsetRange 5.00ns 199.96M After: string length 10: FindFirstOfRange 1.36ns 732.92M FindFirstOfOffsetRange 1.36ns 732.61M ============================================================================ string length 256: FindFirstOfRange 1.36ns 732.93M FindFirstOfOffsetRange 1.38ns 727.16M ============================================================================ string length 10240: FindFirstOfRange 1.36ns 732.93M FindFirstOfOffsetRange 1.79ns 558.40M ============================================================================ string length 10485760: FindFirstOfRange 1.36ns 732.93M FindFirstOfOffsetRange 2.73ns 366.44M Test Plan: fbconfig folly && fbmake runtests Reviewed By: delong.j@fb.com FB internal diff: D660125
-
- 16 Dec, 2012 30 commits
-
-
Gaurav Jain authored
Summary: Fixes instances of the following problems: error: offset of on non-POD type 'folly::fbstring_core<char>::RefCounted' [-Werror,-Winvalid-offsetof] Solution: Since the atomic is not a POD I used sizeof() instead to calculate the offset warning: C++11 requires lambda with omitted result type to consist of a single return statement Solution: Specify a return type error: in-class initializer for static data member is not a constant expression Solution: Move initializer Test Plan: - Compiled folly and ran fbmake runtests Reviewed By: andrei.alexandrescu@fb.com FB internal diff: D656963
-
Tudor Bosman authored
Summary: Everything worked except for getting properly aligned full blocks because 1ULL << 64 is invalid (the shift amount must be strictly less than the value size in bits) Test Plan: test added Reviewed By: philipp@fb.com FB internal diff: D657800
-
Tudor Bosman authored
Test Plan: compiles Reviewed By: philipp@fb.com FB internal diff: D657623
-
Tudor Bosman authored
Summary: Mechanical. Test Plan: fbconfig unicorn/test unicorn/diskindex3 unicorn/diskindex4/test common/datastruct:css_tree_test folly/test:padded_test dragon/test:posting_list_test && fbmake opt Reviewed By: soren@fb.com FB internal diff: D649539
-
Tom Jackson authored
Summary: TSIA Test Plan: Unit tests Reviewed By: kedarb@fb.com FB internal diff: D652180
-
Nicholas Ormrod authored
Summary: The test doesn't run when GCC < 4.7, however our test framework needs some output anyways. I've added a placeholder test that does nothing, but does cause something to be printed. Test Plan: run fbmake runtests on folly/test/stl_tests/ Reviewed By: andrei.alexandrescu@fb.com FB internal diff: D652161
-
Christopher Berner authored
Summary: Add specialized dynamic converter for containers of pairs, which can convert from a list of pairs, or from a object Test Plan: added a unit test Reviewed By: njormrod@fb.com FB internal diff: D650730
-
Nicholas Ormrod authored
Summary: This is FBVector 2.0. It supports all of the original FBVector optimizations and is standard compliant. Accompanying this diff are two suites, StlVectorTest and Benchmark. StlVectorTest runs an extensive battery of tests against a vector implementation per the N3337 standard. In addition to checking normal correctness, StlVectorTest checks the use of allocators, exception safety, memory leaks, and type requirements. Benchmark run a wide range of speed tests between std::vector, the original fbvector, and the new fbvector. Test Plan: First test: run StlVectorTest. Second test: run Benchmark. Third test: compile and run some fbcode (e.g. multifeed/). Reviewed By: andrei.alexandrescu@fb.com FB internal diff: D566719
-
Nicholas Ormrod authored
Summary: Added IsBits (has value semantics; can be copied by memcpy and deleted by free. Implies IsRelocatable) and Is0Initializable (new (ptr) T() is equivalent to memset(ptr, 0, sizeof(T))). Converted the boost types for IsRelocatable to std types (now available from <type_traits>). Added a new way to specify IsRelocatable, IsBits, and Is0Initializable: typedef std::true_type <property-name> in your class. No namespace exiting required. This method also supports inheritance, and may be overriden in base classes. Added a test file to test Traits. Test Plan: Run new test file. Compile some real-world code (in my case, multifeed). Reviewed By: andrei.alexandrescu@fb.com FB internal diff: D610996
-
Tom Jackson authored
Summary: I forgot fbmake runtests doesn't build all that's configured, oops. Test Plan: Build folly/experimental/test, run benchmark. Reviewed By: tudorb@fb.com FB internal diff: D647191
-
Philip Pronin authored
Summary: It makes sense to return subpiece of the original data from ##rest()##. Test Plan: gv tests Reviewed By: soren@fb.com FB internal diff: D647179
-
Tom Jackson authored
Summary: It was previously breaking any time a generator included a comma, which is pretty stupid. Now, it's modelled after `ScopeGuard`, using a little operator overloading to get rid of the trailing `)` and sidestepping preprocessor issues. Test Plan: Unit tests Reviewed By: tudorb@fb.com FB internal diff: D646825
-
Tudor Bosman authored
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
-
Soren Lassen authored
Summary: I noticed that push_back(Char) was slower for fbstring than for std::string for long strings and found that I could make it faster by inlining the call to mutable_data() and exploit that it's always non-small and non-shared. Benchmarks before: ./folly/test/FBStringTestBenchmarks.cpp.h relative time/iter iters/s BM_push_back_string(1) 69.42ns 14.41M BM_push_back_string(23) 582.31ns 1.72M BM_push_back_string(127) 1.47us 682.12K BM_push_back_string(1024) 5.52us 181.07K BM_push_back_fbstring(1) 9.55ns 104.74M BM_push_back_fbstring(23) 212.45ns 4.71M BM_push_back_fbstring(127) 864.00ns 1.16M BM_push_back_fbstring(1024) 6.73us 148.52K and after: BM_push_back_fbstring(1) 9.55ns 104.74M BM_push_back_fbstring(23) 212.45ns 4.71M BM_push_back_fbstring(127) 783.08ns 1.28M BM_push_back_fbstring(1024) 4.03us 248.05K Test Plan: fbconfig folly/test && fbmake runtests Reviewed By: tudorb@fb.com FB internal diff: D646081
-
Helios Alonso Cabanillas authored
Summary: Added closing curly braces at 173. Sorry, must make diff if it's a new commit. Test Plan: nothing really Reviewed By: andrei.alexandrescu@fb.com FB internal diff: D644925
-
Helios Alonso Cabanillas authored
Summary: Added two samples of use for FBVector in docs Test Plan: just check if FBVector.md looks good. Reviewed By: njormrod@fb.com FB internal diff: D636813
-
Yiding Jia authored
Summary: This code is not strictly correct per c++ spec section 14.2.4: > When the name of a member template specialization appears after . or -> in a > postfix-expression or after a nested-name-specifier in a qualified-id, and the > object or pointer expression of the postfix-expression or the > nested-name-specifier in the qualified-id depends on a template parameter > (14.6.2) but does not refer to a member of the current instantiation > (14.6.2.1), the member template name must be prefixed by the keyword template. > Otherwise the name is assumed to name a non-template. This causes clang to complain, but gcc is lax about this, as usual. Test Plan: compile stuff that use this. Reviewed By: delong.j@fb.com FB internal diff: D643515
-
Yiding Jia authored
Summary: the old code is ill-formed per spec (section 14.6.8): > If a type used in a non-dependent name is incomplete at the point at which a > template is defined but is complete at the point at which an instantiation is > done, and if the completeness of that type affects whether or not the program > is well-formed or affects the semantics of the program, the program is > ill-formed; no diagnostic is required. GCC is lax and allows this, clang gives an error. Test Plan: compiles. Reviewed By: delong.j@fb.com FB internal diff: D643431
-
Yiding Jia authored
Summary: curiously, std::out_of_range doesn't have a zero-argument constructor according to the spec. This was causing issues in my clang setup... Test Plan: compiles. Reviewed By: delong.j@fb.com FB internal diff: D643363
-
Tudor Bosman authored
Test Plan: looked at the generated html in a browser Reviewed By: andrei.alexandrescu@fb.com FB internal diff: D642998
-
Davide Bolcioni authored
Summary: Added specializations of folly::to<String> for __int128_t and __uint128_t. Test Plan: Added tests of the above to the integral to string tests. Reviewed By: andrei.alexandrescu@fb.com FB internal diff: D636992
-
Sergey Doroshenko authored
Summary: Returns number of bytes "really used by the user", i.e. number of bytes allocated on the arena via calls to `allocate()`. Test Plan: compiled, unit tests Reviewed By: azzolini@fb.com FB internal diff: D636976
-
Tom Jackson authored
Summary: Supressing the warning for GCC4.7, and supressing the error supressing the warning in GCC4.6. Test Plan: Compile, run unit tests on GCC4.6 and GCC4.7 Reviewed By: ldbrandy@fb.com FB internal diff: D635982
-
Soren Lassen authored
Summary: Noticed these TODOs in Conv.h and decided to fix them. Discovered that the underlying_type implementation also covers enum classes, which didn't work with the pre-existing code. Test Plan: fbconfig -r folly --platform=gcc-4.7.1-glibc-2.14.1-fb fbmake dbg _bin/folly/test/conv_test _bin/folly/test/conv_test --platform=gcc-4.6.2-glibc-2.13 fbmake dbg _bin/folly/test/conv_test _bin/folly/test/conv_test Reviewed By: tudorb@fb.com FB internal diff: D634309
-
Alan Frindell authored
Summary: D633912 broke unicorn because it relied on preallocate having a hard max. Add an optional hard max parameter and rename maxHint to newAllocationSize. Pass the hard max in for unicorn Test Plan: folly and unicorn unit tests Reviewed By: tudorb@fb.com FB internal diff: D634894
-
Alan Frindell authored
Summary: IOBufQueue::preallocate currently takes a min and max size, and will return to the caller a buffer with N writable bytes with min <= N <= max. This is a bit wasteful, since there may be more than max bytes available at the end if the queue with no extra cost. Now preallocate will return the full amount of contigious space to the caller, even if it is larger than the requested max. Test Plan: folly and proxygen unit tests Reviewed By: simpkins@fb.com FB internal diff: D633912
-
Dave Watson authored
Summary: cursor.clone() will clone a length of the chain. insert(std::move(buf)) will splice in a length of chain I want this to change thrift2 binary type to IOBuf: we will clone() the network data for zero-copy userspace data, and insert() it if the return value is a IOBuf. Test Plan: added unittest Reviewed By: afrind@fb.com FB internal diff: D632073
-
Adam Simpkins authored
Summary: Add a version of IOBuf::copyBuffer() which accepts a std::string, as well as a maybeCopyBuffer() function which returns a null pointer if the input string is empty. In proxygen we have a few places where we construct an IOBuf from a string configuration parameter, and we almost always want a null pointer rather than an empty IOBuf chain if the string is empty. Test Plan: Included unit tests for these new functions. Reviewed By: tudorb@fb.com FB internal diff: D630547
-
Tom Jackson authored
Summary: ##byLine## already yields StringPieces, no neat to ##eachAs()## then. Test Plan: fbconfig folly/experimental/symbolizer folly/test folly/experimental/io folly/experimental/io/test tupperware/agent fbmake opt Reviewed By: tudorb@fb.com FB internal diff: D630422
-
Tudor Bosman authored
Test Plan: build Reviewed By: dneiter@fb.com FB internal diff: D630324
-