1. 03 Mar, 2015 23 commits
    • Hannes Roth's avatar
      Revert: (Wangle) Clean up move constructors · 5e32096c
      Hannes Roth authored
      Summary:
      This reverts commit 1e407b48d379a41f32e7a980285dbdf4dadb2e33.
      
      Test Plan: revert-hammer
      
      Reviewed By: yitingli@fb.com
      
      Subscribers: folly-diffs@, jsedgwick, yfeldblum
      
      FB internal diff: D1858994
      
      Signature: t1:1858994:1424386588:5c4608ecbe1f9ab1108ac12e506b157b54d0078b
      5e32096c
    • Hannes Roth's avatar
      (Wangle) Clean up move constructors · 0fd618d4
      Hannes Roth authored
      Summary:
      These were doing more assignments than necessary.
      1) We don't need to set `core_` to `nullptr` and then immediately
      overwrite it with `other.core_`.
      2) Don't need to swap the booleans (this was actually an unitialized
      memory access).
      
      Test Plan: Ran all the tests.
      
      Reviewed By: hans@fb.com
      
      Subscribers: trunkagent, folly-diffs@, jsedgwick, yfeldblum
      
      FB internal diff: D1852386
      
      Signature: t1:1852386:1424375154:25997209e76ccd16169125597e868932a5143ffb
      0fd618d4
    • Michael Lee's avatar
      Remove @/folly dependency from folly/io:compression · 37dd79a6
      Michael Lee authored
      Summary: This diff should let us include folly/io:compression into iOS and Android projects without pulling in a lot of dependencies and should allow the use of zlib.
      
      Test Plan: fbconfig -r folly/io/tests && fbmake runtests
      
      Reviewed By: seanc@fb.com
      
      Subscribers: trunkagent, bmatheny, folly-diffs@, yfeldblum, seanc, benyluo
      
      FB internal diff: D1853058
      
      Tasks: 6245912
      
      Signature: t1:1853058:1424370881:2ea243d93e6041502e5e356fa430c2483f652b40
      37dd79a6
    • Dave Watson's avatar
      use ServerBootstrap · 59e4f0d0
      Dave Watson authored
      Summary:
      Use server bootstrap.
      
      * code reuse
      * Allows multiple accept threads easily.
      
      Accept now doesn't happen in the server's eventBase, but a new thread.
      
      I think I hit all the corner cases involving existingSocket, duplex, stopListening(), etc.
      
      There are a lot of minor changes here to support all the cases, let me know if I should split anything to separate diffs
      
      Test Plan: fbconfig -r thrift/lib/cpp2; fbmake runtests
      
      Reviewed By: hans@fb.com
      
      Subscribers: haijunz, yfeldblum, ruibalp, fbcode-common-diffs@, davejwatson, jsedgwick, trunkagent, doug, alandau, bmatheny, mshneer, folly-diffs@, mcduff, andrewcox, fugalh
      
      FB internal diff: D1732895
      
      Tasks: 5788102
      
      Signature: t1:1732895:1423087631:379bbb131c35ce2221801bc7cec226f87ba0b1d9
      59e4f0d0
    • Dave Watson's avatar
      some moar unittests · 42f4cd7c
      Dave Watson authored
      Summary: from discussion
      
      Test Plan: unit tests
      
      Reviewed By: hans@fb.com
      
      Subscribers: doug, folly-diffs@, jsedgwick, yfeldblum
      
      FB internal diff: D1829282
      
      Signature: t1:1829282:1423180907:3630dac1378750b05f316c672fbbd71138d2bc0a
      42f4cd7c
    • Dave Watson's avatar
      Use folly's async udp socket · 8f54229a
      Dave Watson authored
      Summary: They are functionaly equivalent, no need to have more than one
      
      Test Plan: fbconfig -r realtime/voip; fbmake runtests
      
      Reviewed By: naizhi@fb.com
      
      Subscribers: trunkagent, doug, ps, bmatheny, folly-diffs@, yfeldblum
      
      FB internal diff: D1828044
      
      Tasks: 6154007
      
      Signature: t1:1828044:1423165354:f71d2fd28ca76a8f67a597c747f8578d2909823c
      8f54229a
    • Andrii Grynenko's avatar
      Kill get_fast/get_weak_fast Singletonn API · 5d1db31b
      Andrii Grynenko authored
      Summary: After D1827390 regular get and get_weak is comparable to Meyers and static singletons, so there's no need to keey _fast APIs.
      
      Test Plan: benchmark && fbmake
      
      Reviewed By: mshneer@fb.com
      
      Subscribers: trunkagent, configerator-diffs@, fbcode-common-diffs@, mcduff, hitesh, mshneer, fugalh, acampi, alikhtarov, folly-diffs@, jsedgwick, yfeldblum
      
      FB internal diff: D1843219
      
      Signature: t1:1843219:1424216566:f2f182a1c86bb5f0fb1f978d8c6b7a4388198f5f
      5d1db31b
    • Andrei Alexandrescu's avatar
      Migrate FunctionScheduler from common/concurrency/ to folly/experimental/ · b35c3434
      Andrei Alexandrescu authored
      Summary: This are the open-source-related additions. A separate diff will replace the current implementation in common/concurrency/ to use this one.
      
      Test Plan: fbmake runtests
      
      Reviewed By: simpkins@fb.com
      
      Subscribers: trunkagent, net-systems@, folly-diffs@, yfeldblum
      
      FB internal diff: D1845525
      
      Signature: t1:1845525:1424207291:d30e3c5e85222527c2aff39c1250aa1e41b9a2cf
      b35c3434
    • Sara Golemon's avatar
      Reformat comment for readability, 80-col rule, and gcc cleanliness · 753e1e5a
      Sara Golemon authored
      Summary:
      The continuation at the end of the line with the while
      was causing gcc to complain about it because it's a
      single line comment.
      
      Reformat it into a multiline comment and wrap it to 80 chars.
      
      Test Plan: It's just a comment...
      
      Reviewed By: paulbiss@fb.com
      
      Subscribers: trunkagent, folly-diffs@, yfeldblum
      
      FB internal diff: D1850876
      
      Signature: t1:1850876:1424124973:b2afbc2a8177ac6d11a21bf5a52093bcfd9cbb3e
      753e1e5a
    • Hannes Roth's avatar
      (Wangle) Shrink Core to 128 bytes · f30a65d2
      Hannes Roth authored
      Summary: I think this makes sense, especially if `interrupt_` is really rare.
      
      Test Plan:
      ============================================================================
      folly/futures/test/Benchmark.cpp                relative  time/iter  iters/s
      ============================================================================
      constantFuture                                             101.25ns    9.88M
      promiseAndFuture                                  92.86%   109.03ns    9.17M
      withThen                                          28.96%   349.65ns    2.86M
      ----------------------------------------------------------------------------
      oneThen                                                    337.33ns    2.96M
      twoThens                                          58.46%   577.06ns    1.73M
      fourThens                                         32.42%     1.04us  961.23K
      hundredThens                                       1.45%    23.24us   43.04K
      ----------------------------------------------------------------------------
      no_contention                                                4.45ms   224.48
      contention                                        72.89%     6.11ms   163.61
      ----------------------------------------------------------------------------
      throwAndCatch                                                6.34us  157.77K
      throwAndCatchWrapped                              95.65%     6.63us  150.91K
      throwWrappedAndCatch                             142.58%     4.45us  224.95K
      throwWrappedAndCatchWrapped                      488.86%     1.30us  771.27K
      ----------------------------------------------------------------------------
      throwAndCatchContended                                        1.01s  987.01m
      throwAndCatchWrappedContended                    100.03%      1.01s  987.27m
      throwWrappedAndCatchContended                    148.37%   682.86ms     1.46
      throwWrappedAndCatchWrappedContended            18765.19%     5.40ms   185.21
      ============================================================================
      
      Compare to D1843129#31 (seems to be an improvement?)
      
      Reviewed By: hans@fb.com
      
      Subscribers: trunkagent, folly-diffs@, jsedgwick, yfeldblum
      
      FB internal diff: D1847843
      
      Signature: t1:1847843:1423855151:3602d49df245eda3f85325ab5efd63514213ca44
      f30a65d2
    • Jim Meyering's avatar
      ExceptionWrapperTest.cpp vs clang's new warning about side effects in typeid argument list · 82b788f5
      Jim Meyering authored
      Summary:
      Disable the -Wunevaluated-expression warning for this test:
      
      EXPECT_EQ(typeid(ie), typeid(IntException));
      
      Otherwise, clang warns about the unevaluated expression because
      the expansion of EXPECT_EQ applies sizeof to an expression
      with side effects:
      
      folly/test/ExceptionWrapperTest.cpp:179:122: error: expression with side effects has no effect in an unevaluated context [-Werror,-Wunevaluated-expression]
      switch (0) case 0: default: if (const ::testing::AssertionResult gtest_ar = (::testing::internal:: EqHelper<(sizeof(::testing::internal::IsNullLiteralHelper(typeid(ie))) == 1)>::Compare("typeid(ie)", "typeid(IntException)", typeid(ie), typeid(IntException)))) ; else ::testing::internal::AssertHelper(::testing::TestPartResult::kNonFatalFailure, "folly/test/ExceptionWrapperTest.cpp", 179, gtest_ar.failure_message()) = ::testing::Message();
      
      Test Plan:
      Ensure this compiles with clang-3.4, 3.5 and clang:dev.
      I.e., ensure that this prints PASS at the end.
      
      for i in '' 3.5 dev; do
      test -n "$i" && i=--with-project-version=clang:$i
      fbconfig -r --clang $i folly/test:exception_wrapper_test && fbmake dbgo
      done && echo PASS
      
      Reviewed By: mpawlowski@fb.com
      
      Subscribers: mathieubaudet, folly-diffs@, yfeldblum
      
      FB internal diff: D1850778
      
      Tasks: 6244745
      
      Signature: t1:1850778:1424111029:136478e9a3cc3a219047547d501de4c579a1a181
      82b788f5
    • Jim Meyering's avatar
      wangle: make new pragma use portable to older clang · 2b4d1dea
      Jim Meyering authored
      Summary:
      * folly/wangle/channel/test/MockChannelHandler.h:
      Avoiding a new warning that rendered this file uncompilable
      by clang-3.5 and older.  Add cpp conditionals to protect
      against that.
      
      Test Plan:
      Ensure it works with clang-3.4, 3.5 and clang:dev.
      I.e., ensure that this prints PASS at the end.
      
      for i in '' 3.5 dev; do
      test -n "$i" && i=--with-project-version=clang:$i
      fbconfig -r --clang $i folly/wangle/channel/test && fbmake runtests_dbgo
      done && echo PASS
      
      Reviewed By: meyering@fb.com
      
      Subscribers: mpawlowski, fugalh, mathieubaudet, folly-diffs@, jsedgwick, yfeldblum
      
      FB internal diff: D1849474
      
      Tasks: 6244745
      
      Blame Revision: D1848330
      @build-break
      2b4d1dea
    • Jim Meyering's avatar
      folly: OptionalTest.cpp: suppress a -Wself-move warning · cb2d6c84
      Jim Meyering authored
      Summary:
      Clang's new -Wself-move warning dings this code:
      
      b = std::move(b);
      
      But in this case, that is a deliberate test of
      this capability, so we suppress that particular
      warning for the duration of this small test function.
      
      Test Plan:
      Run this and note that it now compiles: (it passes the tests, too)
      fbconfig --clang --with-project-version=clang:dev -r folly/test:optional_test && fbmake dbgo
      
      Reviewed By: watashi@fb.com
      
      Subscribers: folly-diffs@, yfeldblum
      
      FB internal diff: D1849689
      
      Tasks: 6244745
      
      Signature: t1:1849689:1423877932:4f479d682bd8ba97dcabed7fc29ce0a22c013969
      
      @build-break (using this to work around bogus push failure: https://phabricator.fb.com/P19730606)
      cb2d6c84
    • Jim Meyering's avatar
      folly/ExceptionWrapper.h: avoid warning about typeid operand side effects · a3259f63
      Jim Meyering authored
      Summary:
      * folly/ExceptionWrapper.h (class_name): Clang is not yet smart enough to
      see that there is no harm in dereferencing an "item_" that we've just
      verified is non-NULL.  Accommodate it, to avoid this:
      ./folly/ExceptionWrapper.h:199:30: error: expression with side effects will be evaluated despite being used as an operand to 'typeid' [-Werror,-Wpotentially-evaluated-expression]
      return demangle(typeid(*item_));
      ^
      
      Test Plan:
      Run these commands and note there are fewer errors than before:
      fbconfig --clang --with-project-version=clang:dev -r folly && fbmake dbgo
      
      Reviewed By: mhorowitz@fb.com
      
      Subscribers: trunkagent, yfeldblum, folly-diffs@
      
      FB internal diff: D1848327
      
      Tasks: 6244745
      
      Signature: t1:1848327:1423869597:a58c9e9e3671befb78ae07fbd274a13d08ffb2a7
      
      Blame Revision:
      a3259f63
    • Yedidya Feldblum's avatar
      clang:dev rejects vector<atomic<T>> in EventBaseTest.cpp. · bb4612a0
      Yedidya Feldblum authored
      Summary: [Folly] clang:dev rejects vector<atomic<T>> in EventBaseTest.cpp.
      
      Test Plan: Build and run `folly/io/async/test/EventBaseTest.cpp` using the current `clang`; try building with `clang:dev` and verifying that at least the related failures are gone.
      
      Reviewed By: meyering@fb.com
      
      Subscribers: mathieubaudet, folly-diffs@, yfeldblum, dougw, brettp
      
      FB internal diff: D1848749
      
      Tasks: 6244720
      
      Signature: t1:1848749:1423866420:7b7354d4568b6a6d6a824236ae8d271f6855d90b
      bb4612a0
    • Jim Meyering's avatar
      folly: move side effects out of EXPECT_EQ args · 0234d5d1
      Jim Meyering authored
      Summary:
      This avoids warnings about e.g., sizeof(k++) that result
      from macro expansion.
      * folly/futures/test/ExecutorTest.cpp: Move increment out
      of macro argument list.
      * folly/test/FBVectorTestBenchmarks.cpp.h: Likewise.
      * folly/test/LazyTest.cpp: Likewise.
      Otherwise, we'd get errors like this:
      
      folly/test/LazyTest.cpp:49:118: error: expression with side effects has no effect in an unevaluated context [-Werror,-Wunevaluated-expression]
      switch (0) case 0: default: if (const ::testing::AssertionResult gtest_ar = (::testing::internal:: EqHelper<(sizeof(::testing::internal::IsNullLiteralHelper(++globalCount())) == 1)>::Compare("++globalCount()", "1", ++globalCount(), 1))) ; else ::testing::internal::AssertHelper(::testing::TestPartResult::kNonFatalFailure, "folly/test/LazyTest.cpp", 49, gtest_ar.failure_message()) = ::testing::Message();
      ^
      
      Test Plan:
      Run these commands and note there are fewer errors than before:
      fbconfig --clang --with-project-version=clang:dev -r folly && fbmake dbgo
      
      Reviewed By: njormrod@fb.com
      
      Subscribers: folly-diffs@, jsedgwick, yfeldblum
      
      FB internal diff: D1848324
      
      Tasks: 6244745
      
      Signature: t1:1848324:1423860890:bce44c5e0895804a21957893ae6b78e76dfbc4d3
      0234d5d1
    • Jim Meyering's avatar
      folly: avoid new warnings from -Winconsistent-missing-override · ccb229d5
      Jim Meyering authored
      Summary:
      Upgrading to clang:dev (clang >3.6) brought in some new warnings.
      This change address all of the issues exposed by the new
      -Winconsistent-missing-override, usually by simply adding the
      missing "override" keyword.  However, in
      folly/wangle/channel/test/MockChannelHandler.h, I chose
      to ignore those warnings for the mocked functions.
      * folly/futures/test/ViaTest.cpp: Add missing "override"(s).
      * folly/io/async/AsyncSSLSocket.h: Likewise.
      * folly/io/async/AsyncSocket.h: Likewise.
      * folly/io/async/EventBase.h: Likewise.
      * folly/test/ExceptionWrapperTest.cpp: Likewise.
      * folly/wangle/channel/AsyncSocketHandler.h: Likewise.
      * folly/wangle/channel/test/MockChannelHandler.h: Ignore
      the new warning for these functions.
      
      Test Plan:
      Run these commands and note there are fewer errors than before:
      fbconfig --clang --with-project-version=clang:dev -r folly && fbmake dbgo
      
      Reviewed By: hans@fb.com
      
      Subscribers: trunkagent, fugalh, folly-diffs@, jsedgwick, yfeldblum
      
      FB internal diff: D1848330
      
      Tasks: 6244745
      
      Signature: t1:1848330:1423858909:b167ca220d6c9fe036d3adca08cf3053a7a9de16
      ccb229d5
    • Hannes Roth's avatar
      (Wangle) Have Core own an FSM instead of inheriting · 09430395
      Hannes Roth authored
      Summary:
      This seems cleaner. I also moved a Core member around and changed state to be a smaller size to save us 16 bytes. Might be neat to try to get this down to 128?
      
      Fixed compilation with GCC 4.9, too.
      
      Test Plan: Ran all the tests. Will also benchmark.
      
      Reviewed By: hans@fb.com
      
      Subscribers: trunkagent, folly-diffs@, jsedgwick, yfeldblum
      
      FB internal diff: D1843129
      
      Signature: t1:1843129:1423789502:60e56d1af553994991195fcc350d37d644a556ca
      09430395
    • Jonathan Frank's avatar
      Be able to access proxy client IP (including Lua) · 96242018
      Jonathan Frank authored
      Summary:
      Pass TransportInfo object through connection setup.  This allows us to
      pass along additional info from the setup if necessary.
      
      Test Plan:
      Run proxygen on my devserver listening on ipv4 and ipv6 for ports 80 and 443.
      Configure it to run a lua request rule with the following lines:
      
      io.stderr:write("jonlog: proxy " .. conn:getClientAddrOriginal() .. "\n")
      io.stderr:write("jonlog: client " .. request:getClientIPStr() .. "\n")
      
      Run haproxy also on my devserver, listening on ports 8555-8558, with each
      forwarding to one of the four pairs (ipv4-localhost/ipv6-localhost, 80/443)
      
      From my laptop, run curls against each of these four endpoints and make
      sure that we print out "127.0.0.1" as the proxy IP, and my laptop's IP
      as the client IP.
      
      Reviewed By: cgheorghe@fb.com
      
      Subscribers: jsedgwick, yfeldblum, trunkagent, ruibalp, bmatheny, folly-diffs@, dsp, nbm
      
      FB internal diff: D1746590
      
      Tasks: 5688127
      
      Signature: t1:1746590:1423695880:f647964d95636a69a00304e144aef71ee0213d28
      96242018
    • Giuseppe Ottaviano's avatar
      Fix EliasFanoReader position() when past-the-end · c7c65f54
      Giuseppe Ottaviano authored
      Summary:
      `EliasFanoReader::position()` used to return `size() - 1` both when
      the reader is positioned on the last element, and after `next()` is
      called after that (and it return `false`). Now in the latter case
      `position()` returns `size()` (consistently with the usual behaviour
      of past-the-end iterators).
      
      Also fix the return type of `jumpTo`.
      
      Test Plan:
      fbconfig folly/experimental/test:eliasfano_test && fbmake runtests_opt
      
      Reviewed By: philipp@fb.com
      
      Subscribers: trunkagent, folly-diffs@, yfeldblum
      
      FB internal diff: D1846275
      
      Signature: t1:1846275:1423790264:151f5d2e1e09d4e24dfb758473dfb9cd52c070bd
      c7c65f54
    • Keith Adams's avatar
      std::atomicize MicroSpinLock. · c3ca39e2
      Keith Adams authored
      Summary:
      A colleague at another company started making fun of
      MicroSpinLock for its x86 assembly and ad hoc compiler memory
      barriers. Use C++11 (which wasn't really a thing at the time I wrote
      this).
      
      Test Plan: folly's runtests. What else would we like?
      
      Reviewed By: andrei.alexandrescu@fb.com
      
      Subscribers: folly-diffs@, yfeldblum
      
      FB internal diff: D1841563
      
      Signature: t1:1841563:1423780458:a447c081fbd72e3420b23e95dcf26575c9a06798
      c3ca39e2
    • Giuseppe Ottaviano's avatar
      Elias-Fano micro-optimizations · c2c47da2
      Giuseppe Ottaviano authored
      Summary:
      Short skips have been optimized by adding special cases that use simple iteration when it is convenient. Large skips have been optimized by using the broadword selection algorithm by Vigna (improved with ideas by Gog&Petri) instead of iterating on the zeros/ones of the upper bits.
      
      The benchmarks had to be made more granular to measure the differences, in particular they used to test skipping with a fixed skip length for each test, while now we average over a range of skips to better simulate a random distribution.
      
      The improvements are very significant for `skipTo()` on short skips, about 2-3x for skips at distance 1 or 2, which can occur when intersecting dense lists. On large skips the gain is about 17%.
      
      `skip()` exhibits slightly smaller improvements.
      
      before               after
      ============================================================================  ==================
      folly/experimental/test/EliasFanoCodingTest.cpp relative  time/iter  iters/s  time/iter  iters/s
      ============================================================================  ==================
      Next                                                         2.52ns  396.26M     2.52ns  397.28M
      Skip_ForwardQ128(1)                                          8.66ns  115.52M     3.92ns  255.28M
      Skip_ForwardQ128(2)                                          8.37ns  119.42M     5.08ns  197.04M
      Skip_ForwardQ128(4_pm_1)                                     9.67ns  103.41M     7.04ns  142.02M
      Skip_ForwardQ128(16_pm_4)                                   21.44ns   46.65M    19.68ns   50.82M
      Skip_ForwardQ128(64_pm_16)                                  30.86ns   32.40M    27.58ns   36.26M
      Skip_ForwardQ128(256_pm_64)                                 37.80ns   26.45M    32.49ns   30.78M
      Skip_ForwardQ128(1024_pm_256)                               38.99ns   25.65M    33.39ns   29.95M
      Jump_ForwardQ128                                            37.91ns   26.37M    34.05ns   29.37M
      ----------------------------------------------------------------------------  ------------------
      SkipTo_SkipQ128(1)                                          13.87ns   72.10M     4.42ns  226.49M
      SkipTo_SkipQ128(2)                                          18.80ns   53.20M     8.58ns  116.55M
      SkipTo_SkipQ128(4_pm_1)                                     23.59ns   42.38M    11.43ns   87.50M
      SkipTo_SkipQ128(16_pm_4)                                    36.04ns   27.74M    31.19ns   32.06M
      SkipTo_SkipQ128(64_pm_16)                                   53.34ns   18.75M    43.88ns   22.79M
      SkipTo_SkipQ128(256_pm_64)                                  62.27ns   16.06M    49.08ns   20.37M
      SkipTo_SkipQ128(1024_pm_256)                                65.63ns   15.24M    52.24ns   19.14M
      JumpTo_SkipQ128                                             65.89ns   15.18M    54.61ns   18.31M
      ----------------------------------------------------------------------------  ------------------
      Encode_10                                                  111.94ns    8.93M   117.24ns    8.53M
      Encode                                                       5.35ms   187.02     5.64ms   177.15
      ----------------------------------------------------------------------------  ------------------
      Select64                                                     8.07ns  123.96M     8.04ns  124.35M
      ============================================================================  ==================
      
      Test Plan:
      fbconfig folly/experimental/test:eliasfano_test && fbmake runtests_opt
      
      Reviewed By: philipp@fb.com
      
      Subscribers: yfeldblum, fbcode-common-diffs@, chaoyc, search-fbcode-diffs@, unicorn-diffs@, trunkagent, folly-diffs@
      
      FB internal diff: D1793554
      
      Signature: t1:1793554:1423619344:1b078c0789639f317342ebcc77b11fe91859cd7b
      c2c47da2
    • Hannes Roth's avatar
      (Wangle) Catch all exceptions in `then() -> Future` · 3f653ebe
      Hannes Roth authored
      Summary: Saw this while debugging some stuff. Just an oversight, right?
      
      Test Plan: Ran all the tests.
      
      Reviewed By: hans@fb.com
      
      Subscribers: folly-diffs@, jsedgwick, yfeldblum
      
      FB internal diff: D1843016
      
      Signature: t1:1843016:1423704557:d9fdb4b879ab4fcfda54a5fcb16a639df15872b5
      3f653ebe
  2. 12 Feb, 2015 5 commits
    • Sara Golemon's avatar
      Bump version to 26:0 · 7d2497f0
      Sara Golemon authored
      7d2497f0
    • Tom Jackson's avatar
      Making 'just()' reference arguments like 'from()' (fixed) · 117c33c3
      Tom Jackson authored
      Summary: That is, for all inputs except r-values. Now with support for GCC.
      
      Test Plan: Run tests
      
      Reviewed By: ajaymenon@fb.com
      
      Subscribers: moharrami, trunkagent, folly-diffs@, yfeldblum
      
      FB internal diff: D1822339
      
      Signature: t1:1822339:1423683482:027871549d69017a7a23a675025851a0b876ad77
      117c33c3
    • Sara Golemon's avatar
      Remove unsed header from singleton-inl.h · 01d474df
      Sara Golemon authored
      Summary:
      This was recently added by @andrii to provide stack traces,
      but it no longer needed since he now produces them from a hook in
      folly/experimental/SingletonStackTrace.cpp
      
      Test Plan: Continues to build without the include.
      
      Reviewed By: andrii@fb.com
      
      Subscribers: folly-diffs@, yfeldblum, andrii
      
      FB internal diff: D1842654
      
      Signature: t1:1842654:1423696133:cfa91851f28696082f790eb13c3b0b015c813590
      01d474df
    • Nathan Bronson's avatar
      Revert "[folly] TLS cache for AccessSpreader" · 6a9fa4cf
      Nathan Bronson authored
      Summary:
      This reverts commit 4ebb2303bbcf343d7c2bcc95d55557c0a3b444f3.
      The caching mechanism was based on a misunderstanding of the
      implementation of CLOCK_MONOTONIC_COARSE, and is not correct.
      On the plus side, the upstream kernel patch
      
      e76b027e6408 x86,vdso: Use LSL unconditionally for vgetcpu
      
      gets the vdso getcpu from 16 nanos down to 10 (half of which is the
      inherent indirect call).
      
      Test Plan: unit tests
      
      Reviewed By: delong.j@fb.com
      
      Subscribers: trunkagent, bmaurer, tudorb, folly-diffs@, yfeldblum, jdelong
      
      FB internal diff: D1840690
      
      Signature: t1:1840690:1423693026:33801341ec0b83bf47e050be6528c5dd05021ed5
      6a9fa4cf
    • Andrii Grynenko's avatar
      Make Singleton dependency on Symbolizer Facebook-only · 01734a1c
      Andrii Grynenko authored
      Summary: Open-source build was broken because Symbolizer is not part of it.
      
      Test Plan: singleton unit test w/ and w/o SingletonStackTrace.cpp linked in.
      
      Reviewed By: alikhtarov@fb.com
      
      Subscribers: trunkagent, folly-diffs@, yfeldblum
      
      FB internal diff: D1840346
      
      Signature: t1:1840346:1423690004:926c2aa21e0b7916260749120997ad56fab6f742
      01734a1c
  3. 11 Feb, 2015 12 commits
    • Sara Golemon's avatar
      Bump version to 25:0 · 2d8581db
      Sara Golemon authored
      2d8581db
    • Sara Golemon's avatar
      Autodetect pthread_atfork() support · 07367f14
      Sara Golemon authored
      Summary: This is usually available on linux
      
      Test Plan: Existing tests and manual test on arclinux
      
      Reviewed By: mpawlowski@fb.com
      
      Subscribers: folly-diffs@, yfeldblum
      
      FB internal diff: D1840081
      
      Signature: t1:1840081:1423619986:911c95f9f04f286e9f113543ab4b705cf1b17396
      07367f14
    • Ranjeeth Dasineni's avatar
      remove stray / in include path · 7191014d
      Ranjeeth Dasineni authored
      Summary: removing // as it could break some comment parser
      
      Test Plan: unitz
      
      Reviewed By: dancol@fb.com
      
      Subscribers: trunkagent, doug, seanc, folly-diffs@, yfeldblum
      
      FB internal diff: D1830591
      
      Signature: t1:1830591:1423203436:9e8b28b714eb2dc080462ab3e8ce04c176df8586
      7191014d
    • Hans Fugal's avatar
      switch order of method/object in Future::then to match std::bind · d8bc4210
      Hans Fugal authored
      Summary:
      I have half a mind to just rip this out and let people use std::bind if they need this. But I won't be so cruel.
      
      Why isn't this just implemented as `then(std::bind(method, object))` anyway? Is the template soup we have now faster?
      
      Test Plan:
      Fixed the unit tests to use the new format.
      Will look to contbuild to catch all the things this might break (if anyone is using it at all?), and will fix them.
      
      Reviewed By: hannesr@fb.com
      
      Subscribers: trunkagent, exa, folly-diffs@, yfeldblum, jsedgwick, davejwatson
      
      FB internal diff: D1831118
      
      Signature: t1:1831118:1423243771:65db9a89daf14d8bd88331c503ba1ea7ab03b679
      d8bc4210
    • Hans Fugal's avatar
      futures::chain · e1c576b4
      Hans Fugal authored
      Summary:
      `futures::chain<A,Z>(a, b, c, d, e, f, ..., z)` where `a` is a callback suitable for `Future<A>::then` and `z` is a callback suitable for `Future<Y>::then<Z>`.
      
      This will be important, at least in the background, for the new `via`. It will probably also be useful to some user sometime.
      
      I imagine this will be tweaked over time if people find magic ways to get it to deduce the types better. But this works and it's not *too* much trouble to specify A and Z.
      
      Test Plan: unit
      
      Reviewed By: davejwatson@fb.com
      
      Subscribers: trunkagent, exa, folly-diffs@, yfeldblum, jsedgwick
      
      FB internal diff: D1831073
      
      Tasks: 6048744
      
      Signature: t1:1831073:1423259292:711be0e047a2acb706fd74e529d5d5fb6abda566
      e1c576b4
    • Andrii Grynenko's avatar
      folly::Singleton leak diagnostics utils · 9f502239
      Andrii Grynenko authored
      Summary: This adds different types of messages depending on whether Singleton was depending on other Singleton or just leaked. It also adds destruction stack trace for such Singletons (if they were ever destroyed) to help debug such leaks/broken dependencies.
      
      Test Plan: unit test
      
      Reviewed By: chip@fb.com
      
      Subscribers: trunkagent, folly-diffs@, yfeldblum
      
      FB internal diff: D1830526
      
      Signature: t1:1830526:1423266462:ba328b0da0bf4030b1c4f686d8f7b609fd20683c
      9f502239
    • Andrii Grynenko's avatar
      Making each SingletonEntry a singleton · 8f7c257f
      Andrii Grynenko authored
      Summary:
      Most of the singleton construction logic is moved to SingletonEntry, and each SingletonEntry is now also a singleton.
      SingletonVault becomes only responsible for keeping singleton construction order (and potentially dependencies) and destoying them in correct order.
      This also significantly improves perf of get() / get_weak() (not-fast)
      
      This diff is based on D1823663.
      
      Test Plan:
      unit test
      
      ============================================================================
      folly/experimental/test/SingletonTest.cpp       relative  time/iter  iters/s
      ============================================================================
      NormalSingleton                                            333.35ps    3.00G
      MeyersSingleton                                   99.99%   333.39ps    3.00G
      FollySingletonSlow                                49.99%   666.84ps    1.50G
      FollySingletonFast                                95.90%   347.61ps    2.88G
      FollySingletonFastWeak                             2.22%    15.00ns   66.66M
      ============================================================================
      
      Reviewed By: chip@fb.com
      
      Subscribers: trunkagent, folly-diffs@, yfeldblum
      
      FB internal diff: D1827390
      
      Signature: t1:1827390:1423268514:da322d1dcaba54905d478b253f26dd76f890fb4e
      8f7c257f
    • Philip Pronin's avatar
      make decodeVarint accept StringPiece · a11dc9b7
      Philip Pronin authored
      Summary: `decodeVarint` now accepts all of `StringPiece`, `MutableStringPiece`, `ByteRange`, and `MutableByteRange`.
      
      Test Plan: fbconfig -r folly unicorn/utils && fbmake runtests_opt -j32
      
      Reviewed By: ott@fb.com, lucian@fb.com
      
      Subscribers: trunkagent, chaoyc, search-fbcode-diffs@, unicorn-diffs@, folly-diffs@, yzhan, yfeldblum
      
      FB internal diff: D1836805
      
      Signature: t1:1836805:1423534085:cca5c3e83ad699e5d56e1d1e3394644ec3f94dab
      a11dc9b7
    • Andre Pinto's avatar
      typo · 2a9f8165
      Andre Pinto authored
      Summary: Correct typo on docs.
      
      Test Plan: N/A
      
      Reviewed By: alikhtarov@fb.com
      
      Subscribers: folly-diffs@, yfeldblum
      
      FB internal diff: D1836264
      
      Signature: t1:1836264:1423527402:4e5f263f446346f7145c33c671f0b9e694db15fd
      2a9f8165
    • Marcin Pawlowski's avatar
      fix open source build · 2657ebb5
      Marcin Pawlowski authored
      Summary:
      include was missing, causing build to fail on
      Arch Linux with gcc 4.9.2 -- found this while resolving
      other issues.
      
      Test Plan: build folly on my personal linux and on dev server
      
      Reviewed By: viswanath@fb.com
      
      Subscribers: fugalh, folly-diffs@, jsedgwick, yfeldblum
      
      FB internal diff: D1835143
      
      Signature: t1:1835143:1423513128:5dcff69a82878f47b40512711ed254f239399c2c
      2657ebb5
    • Andrii Grynenko's avatar
      Revert "Revert "Using type-tags for test SingletonVaults"" · 4d897276
      Andrii Grynenko authored
      Summary:
      This reverts commit 4893c09795ad4b1187518b184ac4812079039988.
      
      Fix unit test in D1823663.
      
      Test Plan: fbconfig -r folly fbmake dbg
      
      Reviewed By: alikhtarov@fb.com
      
      Subscribers: folly-diffs@, yfeldblum
      
      FB internal diff: D1832645
      
      Signature: t1:1832645:1423267466:6012f1d7700d540c7290c29b01b33148cf91183c
      4d897276
    • Nathan Bronson's avatar
      TLS cache for AccessSpreader · 5569e6fa
      Nathan Bronson authored
      Summary:
      Under Linux the process gtod doesn't contain the current cpu, so
      __vdso_getcpu uses RDTSCP, which makes it cost about 20 nanos.  The gtod
      _does_, however, contain a nanosecond time (for CLOCK_REALTIME_COARSE)
      updated during context switches.  This diff adds a TLS cache that uses
      __vdso_clock_gettime_ns(CLOCK_REALTIME_COARSE) to detect context switches.
      The end result is that AccessSpreader goes from ~20 nanos to ~6.
      
      Test Plan: unit tests
      
      Reviewed By: davejwatson@fb.com
      
      Subscribers: yfeldblum, trunkagent, folly-diffs@
      
      FB internal diff: D1798922
      
      Signature: t1:1798922:1423264298:32312a5e9bddb3b8aa630c146ef708164a6a4651
      5569e6fa