1. 25 Oct, 2017 4 commits
    • Luca Niccolini's avatar
      rework reads/writes · d4f016d5
      Luca Niccolini authored
      Summary:
      the current implementation had problems with scheduling reads and writes and
      it would sometimes get stuck when transfering large chunks of data
      
      here I am restructuring the code to look more like the one in HTTPSession
      
      session flow control is not implemented yet really, it's coming next
      
      Depends on: D6048238
      
      Reviewed By: afrind
      
      Differential Revision: D6048238
      
      fbshipit-source-id: ae601e771154a7f1a669a58a6e05c9e3720e7017
      d4f016d5
    • Marko Novakovic's avatar
      Supply an explicit default dtor impl · 43200974
      Marko Novakovic authored
      Reviewed By: yfeldblum
      
      Differential Revision: D6142252
      
      fbshipit-source-id: 9ac98585a92299ca5915982c65c7d2cfa68bf60f
      43200974
    • Yedidya Feldblum's avatar
      Flesh out Optional members swap, reset, emplace, has_value · 2ca10eee
      Yedidya Feldblum authored
      Summary:
      [Folly] Flesh out `Optional` members `swap`, `reset`, `emplace`, `has_value`.
      
      * `swap` as a member and deriving `noexcept`-ness to mimic `std::optional::swap`.
      * `reset` v.s. `clear` to mimic `std::optional::reset`.
      * `emplace` returning ref and overload taking initializer list to mimic `std::optional::emplace`.
      * `has_value` v.s. `hasValue` to mimic `std::optional::has_value`.
      
      Reviewed By: WillerZ
      
      Differential Revision: D6132775
      
      fbshipit-source-id: 34c58367b9dc63289e4b9721c5e79b1c41ba31e4
      2ca10eee
    • Yedidya Feldblum's avatar
      Simplify IsUniquePtrToSL in IOBuf.h · 2f5439e4
      Yedidya Feldblum authored
      Summary: [Folly] Simplify `IsUniquePtrToSL` in `IOBuf.h`.
      
      Reviewed By: Orvid
      
      Differential Revision: D6131231
      
      fbshipit-source-id: b054ef7ef9f313943a3ac1022ca6a23874a464df
      2f5439e4
  2. 24 Oct, 2017 4 commits
  3. 23 Oct, 2017 8 commits
  4. 22 Oct, 2017 1 commit
  5. 21 Oct, 2017 4 commits
  6. 20 Oct, 2017 3 commits
  7. 19 Oct, 2017 14 commits
    • Christopher Dykes's avatar
      Use nullptr rather than 0 for a null pointer · 0a609930
      Christopher Dykes authored
      Summary: This time aided by clang-tidy's modernize-use-nullptr check.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D6102739
      
      fbshipit-source-id: aeb4bd0a8078d81cc88b766e0a034a37dd25fd1f
      0a609930
    • James Sedgwick's avatar
      move CallOnce to synchronization/ · 18172db6
      James Sedgwick authored
      Summary: as above
      
      Reviewed By: knekritz
      
      Differential Revision: D6088687
      
      fbshipit-source-id: 0efbb7f5fa33b5f553c0c2019658370fc6e8613f
      18172db6
    • Alex Yarmula's avatar
      Handle timekeeperSingleton being nullptr in within() · 084ff8d9
      Alex Yarmula authored
      Summary: When timekeeper singleton no longer exists during shutdown and folly::Singleton::try_get() can return nullptr, make sure nullptr is handled gracefully.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D6101311
      
      fbshipit-source-id: fefeddfbd048d1a7632688bb3526db15b685dd72
      084ff8d9
    • Yedidya Feldblum's avatar
      Add InlineExecutor.cpp to Makefile.am · c7813369
      Yedidya Feldblum authored
      Summary: [Folly] Add `InlineExecutor.cpp` to `Makefile.am`.
      
      Reviewed By: Orvid
      
      Differential Revision: D6101859
      
      fbshipit-source-id: 4cd0f875dedb548189722fd719f4424d485e1b02
      c7813369
    • Yedidya Feldblum's avatar
      Fix fibers build on older boost · 70d3004b
      Yedidya Feldblum authored
      Summary:
      [Folly] Fix `folly/fibers/` build on older boost.
      
      Where `jump_fcontext` takes `intptr_t` rather than an actual pointer, and we warn about implicit conversions from pointers to integral types.
      
      Reviewed By: Orvid
      
      Differential Revision: D6098230
      
      fbshipit-source-id: 61bd7bdff5de728d3febe8b35c97d024ab6f236a
      70d3004b
    • Christopher Dykes's avatar
      Ensure curly-braces around control-flow · 7ebe7c2a
      Christopher Dykes authored
      Summary: The style guidelines say control flow should always have curly braces, and we follow that, mostly. This just uses clang-tidy to clean up everywhere that we weren't.
      
      Reviewed By: markisaa, luciang
      
      Differential Revision: D6097377
      
      fbshipit-source-id: bfe6766c37bd863ecf68851ef93265a200d4259d
      7ebe7c2a
    • James Sedgwick's avatar
      move ApplyTuple to functional/ · bfa61031
      James Sedgwick authored
      Summary: as above
      
      Reviewed By: yfeldblum
      
      Differential Revision: D6086563
      
      fbshipit-source-id: ab7f50ba46ebd1dbef6438f956258b2fbb13cb5c
      bfa61031
    • Peter Alexander's avatar
      Add ProducerConsumerQueue::capacity() · 7111b632
      Peter Alexander authored
      Summary: Simple addition. Easy to track externally, but might as well provide it in the class if it is readily available.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D6093826
      
      fbshipit-source-id: 9d8c02891b2cea9ce0d3f6ea78e1e0055b536eb8
      7111b632
    • Yedidya Feldblum's avatar
      Revert D6050464: [Folly] Move folly/Hash.h to folly/hash/ · dce47b8a
      Yedidya Feldblum authored
      Summary:
      This reverts commit 64eb65aac8e3e7cd0126e65ca3998bfe167e2d73
      
      bypass-lint
      
      Differential Revision: D6050464
      
      fbshipit-source-id: 1ed63f30837dc11ae57b316f1f7cb233a210894a
      dce47b8a
    • Walker Mills's avatar
      Add window overload that takes an executor to prevent stack overflow · ebded22a
      Walker Mills authored
      Summary:
      AIUI, if there is no executor available, then callbacks are executed inline. `folly::window` uses a recursive helper function (`spawn`) to handle chaining callbacks. So if `window` is used on a large enough collection of `Future`s without executors (e.g., created by `makeFuture`, or have otherwise already completed), you get a stack overflow. A minimal repro looks like:
      ```
      
      int main(int argc, char** argv) {
        std::vector<int> v(100000);
        for(int i=0; i < v.size(); i++) {
          v[i] = i;
        }
      
        std::vector<folly::Future<folly::Unit>> f =
            folly::window(
                std::move(v),
                [](int /* unused */) { return folly::makeFuture(); },
                1);
        folly::collectAll(f).get();
      }
      ```
      
      This diff resolves the issue by adding an overload of `folly::window` which takes an executor as its first parameter. The executor-less `window` overload calls through to the new function using an `InlineExecutor` as the default executor.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D6038733
      
      fbshipit-source-id: 5dcab575592650efa2e106f12632ec06817a0009
      ebded22a
    • Yedidya Feldblum's avatar
      Move folly/Hash.h to folly/hash/ · 34a2f64f
      Yedidya Feldblum authored
      Summary: [Folly] Move `folly/Hash.h` to `folly/hash/`.
      
      Reviewed By: jsedgwick
      
      Differential Revision: D6050464
      
      fbshipit-source-id: 64eb65aac8e3e7cd0126e65ca3998bfe167e2d73
      34a2f64f
    • Arkady Shapkin's avatar
      Enable bug workaround also for MSVC 2017.4 · af6ddfa2
      Arkady Shapkin authored
      Summary:
      Workaround a bug in template instantiation in MSVC 2017 U3/4 with /permissive-
      
      https://developercommunity.visualstudio.com/content/problem/81223/incorrect-error-c5037-with-permissive.html
      
      /cc Orvid
      Closes https://github.com/facebook/folly/pull/691
      
      Reviewed By: yfeldblum
      
      Differential Revision: D6085652
      
      Pulled By: Orvid
      
      fbshipit-source-id: f068dc3f8e474163815fc497b05410fe76834a52
      af6ddfa2
    • Boliu Xu's avatar
      Fix incorrect example usage in stop_watch · 5b7fc789
      Boliu Xu authored
      Summary: As titled.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D6087099
      
      fbshipit-source-id: 1c346fa6f65b5ea58e728759905560ae5ad9cc9d
      5b7fc789
    • Richard Fillman's avatar
      Move small fields to avoid padding in AsyncSocket.h and AsyncSSLSocket.h · e5b4d8b8
      Richard Fillman authored
      Summary: Compiled mcrouter with the 'Wpadded' flag to try to find any wasted space. Mcrouter itself did not have anything, but there was a lot in AsyncSocket.h and AsyncSSLSocket.h so looked into those and removed a bit of wasted space
      
      Reviewed By: yfeldblum, brianwatling
      
      Differential Revision: D6033977
      
      fbshipit-source-id: 2dc127208e09980be6a5db576b45d30ac6e044ff
      e5b4d8b8
  8. 18 Oct, 2017 2 commits