- 14 Aug, 2014 3 commits
-
-
Rushi Desai authored
Summary: It would be nice to be able to create a Later with pre-loaded exception. Test Plan: Unit test Reviewed By: hans@fb.com Subscribers: fugalh FB internal diff: D1462810
-
Alan Frindell authored
Summary: This doesn't have many thrift dependencies and I need it for another async class I'm adding to folly. Test Plan: unit tests Reviewed By: alandau@fb.com Subscribers: doug, mcduff, marccelani, mshneer, alandau, bmatheny FB internal diff: D1453095
-
Marc Celani authored
Summary: Checks if IPAddress has not been initialized. Test Plan: unit test Reviewed By: tudorb@fb.com Subscribers: tudorb FB internal diff: D1459525
-
- 25 Jul, 2014 17 commits
-
-
Chip Turner authored
-
Chip Turner authored
Summary: Singletons are surprisingly tricky in a codebase where libraries depend on one another. folly::Singleton hopes to make this process more reliable by ensuring object creation happens in a safe order, that destruction is possible, and that singletons are created on-demand. The basic fbcode use intention is to invoke registration completion in initFacebook, so users need only declare singletons via Singleton<ClassName> in their .cpp files. This diff ties the Singletons into the core Init process, but not hhvm (which will be a separate diff). Test Plan: runtests Reviewed By: joelm@fb.com, hans@fb.com Subscribers: fbcode-common-diffs@, hphp-diffs@, soren, anca, lins, aalexandre, ps, trunkagent, lucian, hannesr, yfeldblum, maxwellsayles FB internal diff: D1453135
-
Jun LI authored
Summary: Add a method to folly::Uri to get parsed query string e.g. http://localhost?key1=foo&key2=bar We can get key value map containing: "key1" => "foo" "key2" => "bar" Test Plan: fbconfig folly/test fbmake runtests_dbg Reviewed By: tudorb@fb.com Subscribers: wormhole-dev@ FB internal diff: D1455158 Tasks: 4768038
-
Tom Jackson authored
Summary: Sorry, forgot to include tests for the other side of the equation. Test Plan: It is a test Reviewed By: tudorb@fb.com FB internal diff: D1455583
-
Hans Fugal authored
Summary: @jcoens observed in D1451114 that it was unintuitive that you have to retrieve the `Future` before fulfilling the `Promise`. That seemed wrong to me too, but sure enough when I wrote the unit tests that doesn't work (throws "promise already fulfilled" when you call `getFuture`). I think this is just a simple mistake, but I'm going to carefully look at the output of contbuild test suites before committing. Test Plan: red-green careful dependency unit test inspection Reviewed By: jon.coens@fb.com Subscribers: net-systems@, fugalh, exa, jcoens FB internal diff: D1453780
-
Tudor Bosman authored
Summary: Also, regenerate thrift_config.h. Move .gitignore to public_tld so I can add thrift_config.h while still having it checked into fbcode. Test Plan: fbconfig -r thrift && fbmake runtests_opt Reviewed By: meyering@fb.com Subscribers: alandau, bmatheny, jhj, kma, lesha FB internal diff: D1449068
-
Tom Jackson authored
Summary: So integer-like numbers can be formatted in a manner which disambiguates them from integers. Test Plan: Unit tests Reviewed By: tudorb@fb.com Subscribers: jfh, cscheau FB internal diff: D1454446
-
Tudor Bosman authored
Summary: @rkroll wants to run this on more than just fbcode binaries; there are x86 (not x86_64) binaries in there and probably a lot of other junk. So, if you call openNoThrow explicitly, you get a pretty error message in this case. Test Plan: folly/experimental/symbolizer/test Reviewed By: lucian@fb.com Subscribers: rkroll, jhj, lesha, kma FB internal diff: D1453758
-
Tudor Bosman authored
Test Plan: folly/test, OSS build, check the macro in separate file Reviewed By: dancol@fb.com FB internal diff: D1448086
-
Yedidya Feldblum authored
Summary: [Folly] Fix a folly build failure under clang: ConvTest.cpp. Test Plan: Build the unit-test folly/test/ConvTest.cpp with clang. Reviewed By: tudorb@fb.com, njormrod@fb.com Subscribers: mathieubaudet, dougw FB internal diff: D1446232 Tasks: 4723132
-
Yedidya Feldblum authored
Summary: [Folly] Fix a folly build failure under clang: MPMCQueueTest.cpp. In clang-v3.4, there is a bug with the combination of a lambda expression inside a function template taking a template name (rather than a type name) as a template argument. This diff, in the interest of building folly under clang-v3.4, extracts the lambda expression into a separate function so that the function template taking a template name as a template argument no longer has a lambda expression in it. Test Plan: Build folly/test/MPMCQueueTest.cpp under clang. Reviewed By: njormrod@fb.com Subscribers: mathieubaudet, dougw FB internal diff: D1446279 Tasks: 4723132
-
Yedidya Feldblum authored
Summary: [Folly] Fix a folly build failure under clang: FutexTest.cpp. In clang-v3.4, there is a bug with the combination of a lambda expression inside a function template taking a template name (rather than a type name) as a template argument. This diff, in the interest of building folly under clang-v3.4, extracts the lambda expression into a separate function so that the function template taking a template name as a template argument no longer has a lambda expression in it. Test Plan: Build folly/test/FutexTest.cpp under clang. Reviewed By: njormrod@fb.com Subscribers: mathieubaudet, dougw FB internal diff: D1446237 Tasks: 4723132
-
Tyler MacDonald authored
Summary: This is D1422343, but with a one-line change to make it clang-compatible. I authored this diff by first copying the original, then updating, so it's easy to see what I had to change. > on advice of @tudorb, move most of `folly::Formatter` into `folly::BaseFormatter` so that we can use compile-time polymorphism to provide different types of Formatters. Test Plan: ``` fbmake clean fbconfig -r thrift folly cold_storage && fbmake dbg && fbmake runtests fbmake clean fbconfig -r hphp --clang && fbmake dbgo && fbmake runtests ``` Reviewed By: tudorb@fb.com, pt@fb.com Subscribers: mathieubaudet, tudorb FB internal diff: D1440310 Tasks: 4624268, 4667712
-
Brian Pane authored
Summary: * The test computed nonaligned inputs but then copied them into temporary buffers to compare different implementations. The temporary buffers were word-aligned. * This diff keeps the temp buffers but ensures that the data in them keeps the original input's alignment. Test Plan: * Ran the test case with a modified String.cpp containing an assert to catch unaligned reads. The assert failed, as expected, on a copy of the code without the fix from D1434585 Reviewed By: meyering@fb.com Subscribers: ruibalp FB internal diff: D1435028 Tasks: 4696800
-
Alexey Spiridonov authored
Summary: There are a couple of places where this behavior is useful, and it's not 100% trivial to implement it from scratch. Adding it to Folly to save people code & bugs. Test Plan: unit tests Reviewed By: tudorb@fb.com Subscribers: tjackson, folly@lists, tudorb FB internal diff: D1297506
-
Alexey Spiridonov authored
Summary: This way I can reuse it in Subprocess. It also makes it easy to make a bunch of other convenient tokenization routines (e.g. delimiter-preserving folly::gen tokenizers, file tokenizers, etc, etc). Test Plan: fbconfig folly/gen/test && fbmake runtests Reviewed By: tjackson@fb.com Subscribers: vkatich, tjackson FB internal diff: D1317973
-
Marcin Pawlowski authored
Summary: see task: https://our.intern.facebook.com/intern/tasks/?t=4723861 Test Plan: unit tests Reviewed By: marcelo.juchem@fb.com FB internal diff: D1443223 Tasks: 4723861
-
- 21 Jul, 2014 6 commits
-
-
Tudor Bosman authored
-
Philip Pronin authored
Summary: 7.1.5 [dcl.constexpr] / 9 (N3337) requires type to be literal to use it in `constexpr` object declaration (seems to be not enforced by GCC 4.8?) Currently `folly::Range<>` fails one of the requirements: * is an aggregate type, or has at least one constexpr constructor or constructor template that is not a copy or move constructor, Test Plan: fbconfig folly/test:range_test && fbmake runtests_opt -j32 Reviewed By: lucian@fb.com Subscribers: chaoyc, search-fbcode-diffs@, unicorn-diffs@ FB internal diff: D1441646 Tasks: 4720575
-
Zejun Wu authored
Summary: Check for self-assignment in move assignment. Otherwise Optional<Neko> cat = whatever; cat = std::move(cat); cat.hasValue(); // always returns false Test Plan: fbmake runtests Reviewed By: tjackson@fb.com FB internal diff: D1440633
-
Marcin Pawlowski authored
Summary: I modified the toAppend(args..., StringType* dest) so that before appending it reserves enough space for data to be appended. It is still work in progress (floats and doubles are really bad: we only do very naive approximation of the size). On float like workload we gain ~10% perf, on strings/ints/chars we gain as much as 25% of perf. Probably on bigger strings it will be even faster. We only modify the case when toAppend() has more than 1 element to append as it would be just overhead in case of one argument. Test Plan: with this change: ============================================================================ folly/test/ConvTest.cpp relative time/iter iters/s ============================================================================ preallocateTestNoFloat 1.59us 627.85K preallocateTestFloat 1.09us 920.70K ---------------------------------------------------------------------------- ============================================================================ without the change: ============================================================================ folly/test/ConvTest.cpp relative time/iter iters/s ============================================================================ preallocateTestNoFloat 2.12us 471.43K preallocateTestFloat 1.22us 818.25K ---------------------------------------------------------------------------- ============================================================================ Reviewed By: marcelo.juchem@fb.com FB internal diff: D1420588 Tasks: 4632421
-
Marcin Pawlowski authored
Summary: To make MutableStringPiece more usable (and make the implementation of replace* methods easier) I made sure that all the const methods (like find) work for MutableStringPiece in a fashion similar to how they work with StringPiece (work with everything auto convertible to StringPiece). As a result this change is pretty susbstatial in LOC, even though now much happens here. Test Plan: unit tests Reviewed By: marcelo.juchem@fb.com FB internal diff: D1420965 Tasks: 4632424
-
Jim Meyering authored
Summary: * folly/String.cpp (toLowerAscii): Fix two errors: the most important would cause unaligned accesses. This would cause a performance loss in general, but would also result in segfaults on ARM processes. In addition, three conditionals were wrong, further limiting the performance of this code: switch those "<" to "<=". Test Plan: Run this to exercise existing tests: fbconfig folly/test:string_test && fbmake runtests_opt Run this to generate timing stats (before and after this change), e.g., fbconfig folly/test:string_benchmark && fbmake opt _bin/folly/test/string_benchmark > TIMING-toLower-old These numbers show a 1.6% speed increase with this change: --- TIMING-toLower-old 2014-07-14 16:51:12.793523778 -0700 +++ TIMING-toLower-new 2014-07-14 16:49:45.815119145 -0700 @@ -1,6 +1,6 @@ ============================================================================ folly/test/StringBenchmark.cpp relative time/iter iters/s ============================================================================ -libc_tolower 1.06us 941.91K -folly_toLowerAscii 89.99ns 11.11M +libc_tolower 1.06us 941.90K +folly_toLowerAscii 88.57ns 11.29M ============================================================================ Reviewed By: brianp@fb.com Subscribers: FB internal diff: D1434585 Tasks: 4696800 Blame Revision: D1421056
-
- 15 Jul, 2014 4 commits
-
-
Tudor Bosman authored
Reviewed By: lesha@fb.com Test Plan: no
-
Tudor Bosman authored
Test Plan: no Reviewed By: lesha@fb.com Subscribers: alandau, jhj, kma FB internal diff: D1434163
-
Tudor Bosman authored
Summary: Because the version of lz4 that ships by default with Ubuntu 13.10 doesn't define it (but has lz4_decompress_safe, so it's usable) Test Plan: built on Ubuntu 13.10 Reviewed By: meyering@fb.com Subscribers: jhj, lesha, kma FB internal diff: D1433864 @override-unit-failures
-
Pavlo Kushnir authored
Summary: IPAddress operator== throws an exception when comparing ip v6 mapped address with unitialized (default constructed) address. With this diff it returns false. Test Plan: folly unit tests Reviewed By: bmatheny@fb.com FB internal diff: D1421280
-
- 14 Jul, 2014 7 commits
-
-
Gunjan Sharma authored
Summary: Consider a case we found that the queue is empty and unlocked and before our setActive(false) from SCOPE_EXIT gets called (or gets the lock) putMessageImpl got the lock. Now putMessage thinks that we donot want to add another signal but actually we do. Test Plan: Running mcreplay2 without running into this problem on a box. Benchmark: Reviewed By: davejwatson@fb.com FB internal diff: D1428249
-
Tudor Bosman authored
Test Plan: folly/io/test, whatever contbuild dreams up for hphp Reviewed By: meyering@fb.com Subscribers: meyering, hphp-diffs@, ps, jhj, kma, sainbar, lesha FB internal diff: D1429372 @override-unit-failures
-
Elizabeth Smith authored
Summary: Folly is almost "out of the box" working with cygwin This has the proper ifdefs to include cygwin in two areas and a workaround for a cygwin bug when including headers Test Plan: fbconfig -r folly && fbmake runtests Reviewed By: delong.j@fb.com FB internal diff: D1413303
-
Elizabeth Smith authored
Summary: MSVC has all the sockets and internet functionality required except for one missing item - which can safely be defined to a windows specific type But it requires a different set of headers than on *nix systems Test Plan: fbconfig -r folly && fbmake runtests Reviewed By: delong.j@fb.com FB internal diff: D1413265
-
Elizabeth Smith authored
Summary: Use msvc intrinsics for cpuid, popcount, byteswap, and bit scan functionality Test Plan: fbconfig -r folly && fbmake runtests Reviewed By: delong.j@fb.com FB internal diff: D1413254
-
Elizabeth Smith authored
Summary: MSVC 14 is still broken with expression sfinae - and the things that break are often strange Moving this out into two expr templates solves the compilation issue Test Plan: fbconfig -r folly && fbmake runtests Reviewed By: tjackson@fb.com FB internal diff: D1413297
-
Wez Furlong authored
Summary: maelstrom destructs a Promise during an indirect call from maybeCallback and deadlocks on itself unless we use a recursive mutex. There may be a smarter way to proceed but at the moment I can't build and deploy a package from trunk because the service is non-functional :-/ Test Plan: run ``` fbconfig -r folly/wangle messaging/maelstrom fbmake runtests ``` Reviewed By: hannesr@fb.com Subscribers: fugalh, fsilva FB internal diff: D1428504
-
- 09 Jul, 2014 3 commits
-
-
Tudor Bosman authored
Summary: No need to specialize std::hash for std::basic_string; the STL already does this. Plus, the specializations were broken in multiple ways: 1. std::hash does not treat const char* specially, so it just hashes the pointer value (contrasting the old __gnu_cxx::hash, which hashed a C-string) 2. Either way, using __gnu_cxx::hash<const char*> for std::string is broken, as it won't hash anything past the first null byte. Also, make sure fbstring gets the same (full) specializations as std::string does in the standard. Test Plan: fbconfig -r folly && fbmake runtests_opt, also tests in tupperware/agent which is still using __gnu_cxx::hash_map with string keys. Reviewed By: pgriess@fb.com, andrei.alexandrescu@fb.com Subscribers: njormrod, jhj, kma, lesha FB internal diff: D1426479
-
Gunjan Sharma authored
Summary: When we are changing value of numActiveConsumers_ with setActive from handlerReady at the SCOPE_EXIT we have a race with reading of the same variable in putMessageImpl. Test Plan: Had a local race which works fine now. Reviewed By: davejwatson@fb.com Subscribers: trunkagent FB internal diff: D1424674
-
Tudor Bosman authored
Summary: per @rockyliu's suggestions Test Plan: subprocess_test Reviewed By: rockyliu4@fb.com Subscribers: rockyliu, jhj, lesha, kma FB internal diff: D1423157
-