- 16 Dec, 2012 34 commits
-
-
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
-
Tudor Bosman authored
Test Plan: build Reviewed By: tjackson@fb.com FB internal diff: D630280
-
Tudor Bosman authored
Test Plan: test added Reviewed By: tjackson@fb.com FB internal diff: D630163
-
Tudor Bosman authored
Test Plan: build Reviewed By: tjackson@fb.com FB internal diff: D630266
-
Tudor Bosman authored
Summary: Switch existing code to gen::byLine. Also fix namespaces in folly/experimental/(symbolizer|exception_tracer). Test Plan: fbconfig -r folly && fbmake runtests_opt, ran non-test folly binaries by hand, fbgs for other uses (there aren't any) Reviewed By: tjackson@fb.com FB internal diff: D629576
-
Tom Jackson authored
Summary: Normal split to complement resplit, and it's a bit faster than folly::split(). Test Plan: Unit tests, Benchmarks (result in code comment) Reviewed By: tudorb@fb.com FB internal diff: D629998
-
Tudor Bosman authored
Test Plan: no Reviewed By: tjackson@fb.com FB internal diff: D629502
-
Tudor Bosman authored
Summary: Also added eachAs (cast each value as a given type) and eachTo (use folly::to on each value) Test Plan: test added Reviewed By: tjackson@fb.com FB internal diff: D628868
-
Tudor Bosman authored
Summary: Make things work with non-copyable generators. Test Plan: folly/experimental/test Reviewed By: tjackson@fb.com FB internal diff: D628520
-
Philip Pronin authored
Summary: Want to be able to call them from other constexpr functions and from within static_assert()s. Test Plan: compiled and ran folly tests Reviewed By: tudorb@fb.com FB internal diff: D627413
-
Chao Yang authored
Summary: That's all. Test Plan: . Reviewed By: tjackson@fb.com FB internal diff: D618824
-
Tom Jackson authored
Summary: Sometimes it'll be handy to have a custom operator which is little more than the composition of a few base operators. This makes that really easy to do, as shown in examples, tests, and benchmarks. Test Plan: Unit tests, benchmarks Reviewed By: rsagula@fb.com FB internal diff: D617152
-
Tom Jackson authored
Summary: We should be able to print ##Foo*##, even if we can't print ##Foo##. Test Plan: Unit Tests. Reviewed By: tudorb@fb.com FB internal diff: D625977
-
Tom Jackson authored
Summary: If your format string ends up being conditional, it's handy to be able to chain together formatters. Test Plan: Unit tests Reviewed By: tudorb@fb.com FB internal diff: D625502
-
Tudor Bosman authored
Summary: Convert a IOBuf chain into a fbstring, with zero copies in the common case (unshared, unchained, no headroom) and one copy in all other cases. Test Plan: tests added Reviewed By: simpkins@fb.com FB internal diff: D621210
-
Marcelo Juchem authored
Summary: fixing clang errors (used clang 3.1) Test Plan: doh Reviewed By: tudorb@fb.com FB internal diff: D622593
-
Marcelo Juchem authored
Summary: Yes, I admit, I was dumb enough to try it in a benchmark's body. Test Plan: review Reviewed By: tudorb@fb.com FB internal diff: D622613
-
Nicholas Ormrod authored
Summary: DynamicConverter uses some simple heuristics to determine if a class is a container. One of those tests was to check that the constructor 'template <class Iterator> [container-name](Iterator first, Iterator last)' was present. That test was performed by checking if the class could be constructed by two parameters of some dummy class. However, it is possible to restrict the template parameter such that it only accepts iterators, and not any arbitrary dummy class. This would be useful, for example, to solve overload ambiguity with constructors like 'vector(const T& val, size_type n)', where T and size_type are the same (see N3337 23.2.3 item 14). It also (I believe) produces more meaningful compiler errors when a non-iterator is supplied, since it errors at the function callsite instead of inside the constructor itself. The new FBVector implementation uses such a feature, and so checking for [container-name](dummy, dummy) will fail. Hence the dummy class has been upgraded to reverse_iterator<T*>, a valid iterator class which almost certainly does not have a specialized contructor in any class (and hence will not cause any visible change in class_is_container's value). Test Plan: Run DynamicConverterTest; it has tests for the correctness of class_is_container. Reviewed By: delong.j@fb.com FB internal diff: D620607
-
Tudor Bosman authored
Summary: Changed communicate() flags from int to a class. Made Options and CommunicateFlags composable with | Simplified API so you don't have to type Subprocess::Options().stdout(Subprocess::PIPE) Test Plan: subprocess_test Reviewed By: chip@fb.com FB internal diff: D620186
-
Tudor Bosman authored
Test Plan: subprocess_test Reviewed By: delong.j@fb.com FB internal diff: D619713
-
Tudor Bosman authored
Test Plan: subprocess_test Reviewed By: chip@fb.com FB internal diff: D619189
-
Tudor Bosman authored
Summary: Surprised we don't have one. The API is modeled after Python's subprocess module, http://docs.python.org/2/library/subprocess.html Inspired by https://www.facebook.com/groups/fbcode/permalink/445399858830192/, plus I needed this functionality now. Test Plan: test added Reviewed By: chip@fb.com FB internal diff: D614056
-
Misha Shneerson authored
Summary: parseInt128 is only available for GCC 4.7 and above. Test Plan: . Reviewed By: igorzi@fb.com FB internal diff: D618456 Blame Revision: rFBCODEeaec97e2991f
-
Adam Simpkins authored
Summary: Add benchmarks for throwing an exception versus returning std::exception_ptr or other types of return values. Throwing an exception is very expensive. Calling std::make_exception_ptr() without ever throwing is nearly as bad. The exc_ptr_param_return tests were the ones I was most interested in. (Accepting a std::exception_ptr* argument so the caller can indicate if they want to receive an exception or not.) This is fast if the caller doesn't care about the exception value, but very slow if an error occurs and an exception_ptr is required. Test Plan: ====================================================================== folly/test/function_benchmark/main.cpp relative time/iter iters/s ====================================================================== throw_exception 3.90us 256.25K catch_no_exception 1.88ns 533.25M return_exc_ptr 2.79us 357.85K exc_ptr_param_return 2.83us 353.25K exc_ptr_param_return_null 2.25ns 444.38M return_string 69.39ns 14.41M return_string_noexcept 69.39ns 14.41M return_code 1.50ns 666.54M return_code_noexcept 1.50ns 666.54M Reviewed By: rajat@fb.com FB internal diff: D616474
-
Misha Shneerson authored
Summary: Just that. Test Plan: . Reviewed By: igorzi@fb.com FB internal diff: D613291
-
Hari Manikarnika authored
Summary: folly::toJson as demonstrated by the test cases was wrongly encoding utf8 strings. specifically, a utf8 char made up of x bytes was encodeded into x unicode chars. for example, the char: \u2665 which is made of 3 bytes: \xe2\x99\xa5 was encoded correctly when using encode_non_ascii = true: "\u2665" but when encode_non_ascii = false, the json value was wrongly set as: "\u00e2\u0099\u00a5" because we use an signed char that wrongly detects non-readable chars with ascii value > 127 as control chars with ascii value < 32 (\t, \n, etc.) Test Plan: run the test Reviewed By: delong.j@fb.com FB internal diff: D612782
-
- 29 Oct, 2012 6 commits
-
-
Tom Jackson authored
Summary: Tests were run in 'opt', which masked issues alterted by asserts. Test Plan: Unit tests Reviewed By: delong.j@fb.com FB internal diff: D611957
-
Xin Liu authored
Summary: the currently code calls both ~SkipListNode() and node->data_.~value_type() causes double destructing the object. Test Plan: adding dihde's testing code to a test case Reviewed By: emailweixu@fb.com FB internal diff: D612289
-
Marcelo Juchem authored
Summary: fix Benchmark docs Test Plan: read Reviewed By: andrei.alexandrescu@fb.com FB internal diff: D611820
-
Tom Jackson authored
Summary: Moving Comprehensions library into Folly and refactoring its interface to be much more modular and composable. There are now two core abstractions: # Generators: Standalone classes supporting ##apply()## and optionally ##foreach()##. These all inherit from ##GenImpl<T, Self>##. # Operators: Standalone classes which, when composed with a generator, produce a new generator. These all inherit from ##OperatorImpl<Self>##. These generators may be composed with ##operator|## overloads which only match ##const GenImpl<T, Self>&## on the left like ##gen | op##. Additionally, generator may be consumed inline with ##gen | lambda## like ##gen | [](int x) { cout << x << endl; };##. With this design, new operators may be added very simply without modifying the core library and templates are instantiated only exactly as needed. Example: ```lang=cpp auto sum = seq(1, 10) | filter(isPrime) | sum; seq(1, 10) | [](int i) { cout << i << endl; }; ``` Test Plan: Unit tests Reviewed By: andrei.alexandrescu@fb.com FB internal diff: D542215
-
Andrei Alexandrescu authored
Summary: C++11 added front() and back() that return by reference. fbstring also added front() and back() as non-standard convenience functions, which returned by value. This diff aligns fbstring with the standard. Test Plan: added and ran unittest Reviewed By: delong.j@fb.com FB internal diff: D607574
-
Tom Jackson authored
Summary: Optional, like boost::optional, but with full rvalue support. Test Plan: Unit tests Reviewed By: delong.j@fb.com FB internal diff: D571810
-