1. 09 Jun, 2019 2 commits
  2. 08 Jun, 2019 1 commit
    • Yedidya Feldblum's avatar
      Fixed constexpr append in FixedString tests · 336bfca0
      Yedidya Feldblum authored
      Summary:
      [Folly] Fixed constexpr append in `FixedString` tests after {D15618465}.
      
      ```
      folly/test/FixedStringTest.cpp: In member function 'virtual void FixedStringAssignTest_ConstexprAppendLiteral_Test::TestBody()':
      folly/test/FixedStringTest.cpp:360:3: error: non-constant condition for static assertion
         static_assert(constexpr_append_literal_test() == "hello world!", "");
         ^~~~~~~~~~~~~
      In file included from folly/Range.h:25:0,
                       from folly/FixedString.h:33,
                       from folly/test/FixedStringTest.cpp:20:
      folly/test/FixedStringTest.cpp:360:47:   in constexpr expansion of 'constexpr_append_literal_test()'
      folly/test/FixedStringTest.cpp:355:18:   in constexpr expansion of '#'result_decl' not supported by dump_expr#<expression error>.folly::BasicFixedString<char, 20>::append((& s[7]))'
      folly/FixedString.h:1277:48:   in constexpr expansion of 'folly::constexpr_strlen<char>(that)'
      folly/portability/Constexpr.h:68:21: error: 'strlen((& s[7]))' is not a constant expression
         return std::strlen(s);
                ~~~~~~~~~~~^~~
      ```
      
      Reviewed By: simpkins
      
      Differential Revision: D15643402
      
      fbshipit-source-id: c7e26a0c37c956300364c566f211c866985d9dc2
      336bfca0
  3. 07 Jun, 2019 3 commits
    • Nathan Bronson's avatar
      switch vectorized and fallback implementation order · 74f760d6
      Nathan Bronson authored
      Summary:
      It's common for people reading the F14 code to
      see the fallback implementation without noticing the #if
      !FOLLY_F14_VECTOR_INTRINSICS_AVAILABLE at the top, which leads them to
      incorrect conclusions about the code. This diff flips the order in the
      file to reduce confusion.
      
      Reviewed By: shixiao
      
      Differential Revision: D15571969
      
      fbshipit-source-id: 10d2aa29da3f1b8dd48af490a53f1f845f103fa8
      74f760d6
    • Yedidya Feldblum's avatar
      Merge folly/futures/helpers.h into folly/futures/Future.h · 11c136c8
      Yedidya Feldblum authored
      Summary: [Folly] Merge `folly/futures/helpers.h` into `folly/futures/Future.h` to avoid the cyclic include trap.
      
      Differential Revision: D15600550
      
      fbshipit-source-id: a0d14c0092bb433f7af797201d9fafebab370502
      11c136c8
    • Anton Likhtarov's avatar
      getThreadName(): handle bad std::thread::id gracefully · a5fd94a4
      Anton Likhtarov authored
      Summary: pthread_getname_np() tries to dereference 0 when called with it, let's turn it into an error instead
      
      Reviewed By: yfeldblum
      
      Differential Revision: D15708351
      
      fbshipit-source-id: aa2dd92e12e33174c8998daed056de50d4111774
      a5fd94a4
  4. 06 Jun, 2019 14 commits
    • Zeyi (Rice) Fan's avatar
      add level settings to handler · d1c34f8e
      Zeyi (Rice) Fan authored
      Summary:
      This diff adds an option "level" to standard log handler configuration so handlers can have individual logging level set.
      
      This allows us to have multiple handler that handles messages with different level settings.
      
      For example,
      
      > eden=DBG3:default:other; default=stream; other=stream:level=WARN;
      
      This configuration creates two log handlers "default" and "other". Both of the handlers will be receiving log messages level "DBG3" from "eden" log category. In this example, "other" handler will only be receiving log messages that is >= "WARN" while the "default" handler still receives all messages >= "DBG3".
      
      However, one catch of this diff is that, when the log category is set to a higher logging level and the log handler has a lower logging level. The log handler will NOT receive any log messages that is lower than the log category logging level. The test `LogLevelReverseTest` illustrate this situation.
      
      Reviewed By: simpkins
      
      Differential Revision: D15541101
      
      fbshipit-source-id: 741aa97d2d5e93c40324bf6a3dd1d9e38f4dc6a5
      d1c34f8e
    • Dan Melnic's avatar
      Change SharedInfoObserverEntryBase::beforeFreeExtBuffer to... · d7e9357c
      Dan Melnic authored
      Change SharedInfoObserverEntryBase::beforeFreeExtBuffer to SharedInfoObserverEntryBase::afterFreeExtBuffer
      
      Summary: Change SharedInfoObserverEntryBase::beforeFreeExtBuffer to SharedInfoObserverEntryBase::afterFreeExtBuffer
      
      Reviewed By: yfeldblum
      
      Differential Revision: D15687084
      
      fbshipit-source-id: 8f77a123f1bdc0e0ee7391dee7da47d9b9addc6d
      d7e9357c
    • Shrikrishna Khare's avatar
      fbcode_builder: getdeps: fboss: add libnl manifest · 873fd33e
      Shrikrishna Khare authored
      Summary:
      This is towards getting open source FBOSS to build using fbcode_builder.
      libnl is one of the dependencies for FBOSS. This patch adds a manifest
      file to build libnl.
      
      Reviewed By: wez
      
      Differential Revision: D15686853
      
      fbshipit-source-id: f7549df6dc1005630193b024be6e1ea330cc6646
      873fd33e
    • Shrikrishna Khare's avatar
      fbcode_builder: getdeps: fboss: add libcurl manifest · c8fb6d47
      Shrikrishna Khare authored
      Summary:
      This is towards getting open source FBOSS to build using fbcode_builder.
      libcurl is one of the dependencies for FBOSS. This patch adds a manifest
      file to build libcurl.
      
      Reviewed By: wez
      
      Differential Revision: D15683387
      
      fbshipit-source-id: 8df5c413e7dff06d1a19e0ce3b1706bff2f1ab54
      c8fb6d47
    • Shrikrishna Khare's avatar
      fbcode_builder: getdeps: fboss: add libusb manifest · f76eb394
      Shrikrishna Khare authored
      Summary:
      This is towards getting open source FBOSS to build using fbcode_builder.
      libusb is one of the dependencies for FBOSS. This patch adds a manifest
      file to build libusb. FBOSS does not need libudev, so we avoid unncessary
      dependency by passing right argument to ./configure.
      
      Reviewed By: wez
      
      Differential Revision: D15683386
      
      fbshipit-source-id: 1d35caecf4012ddc0df24a7305019d522b4763fa
      f76eb394
    • Andrii Grynenko's avatar
      Disable exception checks if it wasn't thrown by a fiber · 1b24cbe4
      Andrii Grynenko authored
      Summary: If fiber was activated with an exception it's safe for that fiber to be preempted.
      
      Differential Revision: D15640534
      
      fbshipit-source-id: d908aacd81e1ec57874324a58b180587a1fe2eeb
      1b24cbe4
    • Yedidya Feldblum's avatar
      Replace inclusions of folly/futures/helpers.h with folly/futures/Future.h · dff7ae96
      Yedidya Feldblum authored
      Summary: Replace inclusions of `folly/futures/helpers.h` with `folly/futures/Future.h` to avoid the cyclic include trap.
      
      Differential Revision: D15600549
      
      fbshipit-source-id: 19950be24a7437fb1fbec293e24058adf17343ca
      dff7ae96
    • Wez Furlong's avatar
      getdeps: disable ccache on sandcastle · 9add78ae
      Wez Furlong authored
      Summary:
      We sometimes see some flakeyness in our internal CI, so we can live
      without it there.
      
      Reviewed By: pkaush
      
      Differential Revision: D15695124
      
      fbshipit-source-id: 1d76ae89e245d9c95937e8818826c544c0ae8fc3
      9add78ae
    • Takshak Chahande's avatar
      AsyncSocket's ConnectCallback provide additional preConnect · 754409b4
      Takshak Chahande authored
      Summary:
      Currently, AsyncSocket's `connect` API creates new socket, set various
      options, bind it to passed argument address and used it for connecting to
      server.
      
      While most of the things are handled inside that single connect routine; sometimes
      if the caller would like to do few more additional operations before actual
      connect happens; caller would like to have hold on the underneath used socket.
      
      In order to do that additional operation on the socket, this diff provides the
      facility to provide custom pre-connect hook `preConnect(NetworkSocket fd)` in
      the `ConnectCallback` which will be invoked just before the actual server
      connect.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D15282727
      
      fbshipit-source-id: 5beac55c77a9537ee4f26856dd5f78c5224a1f49
      754409b4
    • Uladzislau Paulovich's avatar
      folly | Remove unnecessary reinterpret_cast in Executor · 088fab7c
      Uladzislau Paulovich authored
      Summary: Input and output types for the cast are the same (except const qualifier) and therefore it's not required.
      
      Reviewed By: milend
      
      Differential Revision: D15694981
      
      fbshipit-source-id: d5a811d97cc145ba9c232b79f6c8fa52041b0cf0
      088fab7c
    • Yedidya Feldblum's avatar
      XLOG_EVERY_N_THREAD · 6c7906af
      Yedidya Feldblum authored
      Summary:
      [Folly] `XLOG_EVERY_N_THREAD`.
      
      Implemented with a single per-thread map for all `XLOG_EVERY_N_THREAD` collectively. This approach has better TLS overhad than a `thread_local` counter per `XLOG_EVERY_N_THREAD`, at the cost of integer-keyed map lookups.
      
      While the `thread_local` counter approach is twice as fast as this approach for a noop log-handler, it is expected that the runtime overhead of real log-handlers will make this type of saving immaterial.
      
      Reviewed By: simpkins, luciang
      
      Differential Revision: D15293529
      
      fbshipit-source-id: 7af535a0d329473126a0e4dcffc19d750e8b8b10
      6c7906af
    • Miroslav Crnic's avatar
      LifoSem make tryRemoveNode protected · 8042bf57
      Miroslav Crnic authored
      Summary:
      Lifo sem exposes allocateNode and tryWaitOrPush as protected which allows inherited classes custom Node implementation, creation and enqueueing.
      tryRemoveNode was private which prevented inherited classes from dequeueing a Node without signaling shutdown.
      This diff fixes it
      
      Reviewed By: shixiao
      
      Differential Revision: D15647287
      
      fbshipit-source-id: 5b26a9616f6de559224f9d8c38230780c78a7cf5
      8042bf57
    • Yedidya Feldblum's avatar
      Let KeepAlive::copy() allow dummy executors to expire · d3233089
      Yedidya Feldblum authored
      Summary: [Folly] Let `KeepAlive::copy()` allow dummy executors to expire, and not attempt to dereference them to perform an acquire - which, as is known in advance, would fail and return false were the executor still to be alive.
      
      Reviewed By: andrewcox
      
      Differential Revision: D15683240
      
      fbshipit-source-id: e2026493af6936b8f0f1b8fe3c1cb97d2bf0f96e
      d3233089
    • Yedidya Feldblum's avatar
      Split KeepAlive concepts of dummy and alias · 8d2d67e3
      Yedidya Feldblum authored
      Summary: [Folly] Split KeepAlive concepts of dummy and alias. A dummy KeepAlive is one for an executor which does not actually support keep-alive semantics. An alias KeepAlive is one for which there is another KeepAlive, with a surrounding lifetime, to the same executor.
      
      Reviewed By: andrewcox
      
      Differential Revision: D15683241
      
      fbshipit-source-id: a5809b06c90ed4a655a6973fac67137b5e1981dc
      8d2d67e3
  5. 05 Jun, 2019 7 commits
    • Yedidya Feldblum's avatar
      Avoid gcc7 bug in SerialExecutor test · 86b2ff29
      Yedidya Feldblum authored
      Summary:
      [Folly] Avoid gcc7 lambda-captures bug in `SerialExecutor` test.
      
      ```
      folly/executors/test/SerialExecutorTest.cpp: In lambda function:
      folly/executors/test/SerialExecutorTest.cpp:66:40: error: declaration of 'i' shadows a previous local [-Werror=shadow]
      folly/executors/test/SerialExecutorTest.cpp:60:12: note: shadowed declaration is here
      folly/executors/test/SerialExecutorTest.cpp: In function 'void simpleTest(const std::shared_ptr<folly::Executor>&)':
      folly/executors/test/SerialExecutorTest.cpp:74:45: error: already captured 'i' in lambda expression [-Werror]
      folly/executors/test/SerialExecutorTest.cpp: In lambda function:
      folly/executors/test/SerialExecutorTest.cpp:74:62: error: 'i' is not captured
      folly/executors/test/SerialExecutorTest.cpp:74:46: note: the lambda has no capture-default
      folly/executors/test/SerialExecutorTest.cpp:60:12: note: 'int i' declared here
      ```
      
      Fixes #1154.
      
      Reviewed By: andriigrynenko
      
      Differential Revision: D15629657
      
      fbshipit-source-id: fec82e9d54b2c79a7f54f366ec8a19ad7dc198e9
      86b2ff29
    • Joe Loser's avatar
      Cut FOLLY_HAVE_COMPARE_EQUIVALENT from StringKeyedBenchmark.cpp (#1157) · 59ca4e5c
      Joe Loser authored
      Summary:
      - Cut `FOLLY_HAVE_COMPARE_EQUIVALENT` as this is `1` for Clang 3.4
        onward (regardless of `libstdc++` or `libc++`) and also `1` for GCC
        versions we support.
      Pull Request resolved: https://github.com/facebook/folly/pull/1157
      
      Reviewed By: Orvid
      
      Differential Revision: D15641688
      
      Pulled By: yfeldblum
      
      fbshipit-source-id: 0602913b375a406cce6337e43ba708362a94d444
      59ca4e5c
    • Shrikrishna Khare's avatar
      fbcode_builder: getdeps: fboss: add libmnl manifest · 93d5da3c
      Shrikrishna Khare authored
      Summary:
      This is towards getting open source FBOSS to build using fbcode_builder.
      libmnl is one of the dependencies for FBOSS. This patch adds a manifest file
      to build the specific version of libmnl for FBOSS.
      
      Reviewed By: wez
      
      Differential Revision: D15633176
      
      fbshipit-source-id: dd51997ae950f53842711fbf2d044e84cdf437e7
      93d5da3c
    • Shrikrishna Khare's avatar
      fbcode_builder: getdeps: fboss: add OpenNSL fetcher · d6678a05
      Shrikrishna Khare authored
      Summary:
      This is towards getting open source FBOSS to build using fbcode_builder.
      OpenNSL is one of the dependencies for FBOSS.
      
      OpenNSL is github repository with headers and prebuilt opaque library. Thus, we
      can't/don't need to build it. Thus, OpenNSL manifest uses NopBuilder.
      
      fbcode_builder expects the library to be in installed/lib and headers to be in
      installed/include, but OpenNSL lib structure is different.  Thus, add explicit
      [install.fields] rule for bin/wedge => lib. Once a rule(s) is provided, we must
      provide rule(s) for all, so add rule for include => include as well.
      
      Reviewed By: wez
      
      Differential Revision: D15593639
      
      fbshipit-source-id: facb36ff7b9a31f5952ecbc1a9fdb834c0e68d11
      d6678a05
    • Shrikrishna Khare's avatar
      fbcode_builder: getdeps: fboss: add iproute2 fetcher · cfed36bd
      Shrikrishna Khare authored
      Summary:
      This is towards getting open source FBOSS to build using fbcode_builder.
      iproute2 is one of the dependencies for FBOSS. This patch adds a manifest file
      to build the specific version of iproute2 needed for FBOSS.
      
      Additionally, the default git clone depth of 100 is insufficient for the
      version of iproute2 FBOSS depends on. Thus, this patch extends the git SCHEMA
      to add optional argument depth. The default remains 100.
      
      The usual /configure --prefix does not work for iproute2. Thus, we need to add
      a custom builder that:
        - copies sources to build directory, builds, and
        - installs to installed directory using DEST_DIR.
        - it must also explicitly copy include from build dir to install dir
      
      Reviewed By: wez
      
      Differential Revision: D15588809
      
      fbshipit-source-id: ac5eab24134e078d88b85b4be433c78b05ef8ce5
      cfed36bd
    • Yedidya Feldblum's avatar
      Use std interface in fibers mutex types · d4774463
      Yedidya Feldblum authored
      Summary:
      [Folly] Use std interface in fibers mutex types: `try_lock_for`, `lock_shared`, etc.
      
      This makes fibers mutex types play well with `Synchronized`.
      
      Reviewed By: mnv104
      
      Differential Revision: D15440755
      
      fbshipit-source-id: 068b0c0b973577729f76f78c9063ff2ec06f4d90
      d4774463
    • Marshall Cline's avatar
      pipe fittings between a container/range-v3 and a folly::gen · 45f4b89d
      Marshall Cline authored
      Summary:
      Create pipe-adapters ("pipe fittings") that allow a `|`-based pipeline mixing {std-containers and/or range-v3} with folly::gen, e.g.,
      
      ```
      auto result = myVec              // anything consistent with range-v3 or these adapters
          | ranges::view::filter(...)  // zero-or-more range-v3 pipe-elems
          | <adapter-goes-here>        // <==**one of the pipe-adapters provided by this task**
          | folly::gen::blah();        // trailing pipe-elems are folly::gen
      ```
      
      This diff supplies only adapters that transition from {std-containers and/or range-v3} to folly::gen, but not the other way around.
      
      Q&A:
      
      * Why distinguish containers from range-v3's? E.g., container_to_gen vs. rangev3_to_gen?
          * Containers and range-v3's have different copy-costs: range-v3's have O(1) copy
          * Using two different names lets us separate the implementations so we can know which can be copied without significant overhead.
      * Why `#include` range-v3 from inside folly::gen? Why the dependency?
          * That `#include` / dependency adds value to the process, and it is included only for the client-files that need it.
          * It adds value to the process since the subset of client-files to be migrated are precisely the same subset of client-files that _need_ to include range-v3.
          * The alternative would be to add the `#include` out in all the various client-files during the migration process, and we will do that as the last step in the migration process.
          * The migration process is sped up by including range-v3 for that specific subset of client-files _and_ it hurts no one since only those who need that `#include` actually get it.
          * Note: we limit the `#include` to the subset of files to be migrated via the `FOLLY_USE_RANGEV3` define; see folly-config.h.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D15035294
      
      fbshipit-source-id: 694979850d1f35dd382e3afde792ea51a2397af0
      45f4b89d
  6. 04 Jun, 2019 13 commits
    • Adam Simpkins's avatar
      update EventBaseTest to use precise timing with libevent2 · c3ac4113
      Adam Simpkins authored
      Summary:
      Change the EventBaseTest code to request precise timing from libevent.
      libevent 2.1+ uses a coarse monotonic clock by default on Linux.
      This causes several of folly's timing-related tests for EventBase to fail most
      of the time.
      
      This changes the tests to request precise timing from libevent2, using the
      `EVENT_PRECISE_TIMER`.  While we can request this programmatically, doing so
      portably across libevent versions is awkward, so the environment variable is
      the easiest solution for now.
      
      Alternatively we could change the tests to use larger, coarser timeouts to
      make them pass reliably.  However, this would make the tests slower.
      
      Differential Revision: D15528322
      
      fbshipit-source-id: 20dc55de36235e63910cf7fb5b67c6f2d509cc15
      c3ac4113
    • Adam Simpkins's avatar
      put local classes in EventBaseTest.cpp inside an unnamed namespace · 7bf08cd2
      Adam Simpkins authored
      Summary: Put file-local classes and helper functions into an unnamed namespace.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D15528323
      
      fbshipit-source-id: 9e90aafe4382d9ba237823fea1e68dbea7fa1f2f
      7bf08cd2
    • Yedidya Feldblum's avatar
      Fix references to TTransportException · 13ae097b
      Yedidya Feldblum authored
      Summary: [Folly] Fix references to `TTransportException` in `folly/io/async/` to refer to `AsyncSocketException`.
      
      Reviewed By: jmswen, knekritz
      
      Differential Revision: D15628173
      
      fbshipit-source-id: f6d36ede5e8b33d9407751733bcc9a7fa764815c
      13ae097b
    • Joe Loser's avatar
      Fix -Wstring-plus-int in FixedStringTest.cpp (#1148) · 7b7cc4e6
      Joe Loser authored
      Summary:
      - Clang 8 warns about appending integers to a string using `operator+`
        without a cast.
      
      ```
      ../folly/test/FixedStringTest.cpp:353:23: warning: adding 'unsigned int' to a string does not append to the string [-Wstring-plus-int]
        a.append("X world!" + 2u, 5u);
                 ~~~~~~~~~~~^~~~
      ../folly/test/FixedStringTest.cpp:353:23: note: use array indexing to silence this warning
        a.append("X world!" + 2u, 5u);
                            ^
                 &          [   ]
      ../folly/test/FixedStringTest.cpp:354:23: warning: adding 'unsigned int' to a string does not append to the string [-Wstring-plus-int]
        a.append("X world!" + 7u);
                 ~~~~~~~~~~~^~~~
      ../folly/test/FixedStringTest.cpp:354:23: note: use array indexing to silence this warning
        a.append("X world!" + 7u);
                            ^
                 &          [   ]
      ../folly/test/FixedStringTest.cpp:365:23: warning: adding 'unsigned int' to a string does not append to the string [-Wstring-plus-int]
        a.append("X world!" + 2u, 5u);
                 ~~~~~~~~~~~^~~~
      ../folly/test/FixedStringTest.cpp:365:23: note: use array indexing to silence this warning
        a.append("X world!" + 2u, 5u);
                            ^
                 &          [   ]
      ../folly/test/FixedStringTest.cpp:366:23: warning: adding 'unsigned int' to a string does not append to the string [-Wstring-plus-int]
        a.append("X world!" + 7u);
                 ~~~~~~~~~~~^~~~
      ../folly/test/FixedStringTest.cpp:366:23: note: use array indexing to silence this warning
        a.append("X world!" + 7u);
                            ^
                 &          [   ]
      ```
      
      - Fix this warning by creating a local char[] and using that to append
        to the fixed string
      Pull Request resolved: https://github.com/facebook/folly/pull/1148
      
      Reviewed By: ericniebler
      
      Differential Revision: D15618465
      
      Pulled By: yfeldblum
      
      fbshipit-source-id: 7f72b3597f51d99665da85744aeb8805eb2e8f00
      7b7cc4e6
    • Yedidya Feldblum's avatar
      Fix PriorityUnboundedBlockingQueue priority translation · de733c9a
      Yedidya Feldblum authored
      Summary: [Folly] Fix `PriorityUnboundedBlockingQueue` priority translation from `Executor` priorities to offsets as used by `PriorityUnboundedBlockingQueueSet`.
      
      Reviewed By: andriigrynenko
      
      Differential Revision: D15619435
      
      fbshipit-source-id: 1c5d4d68dfde7f9db07d64f40e73717b48a05ed1
      de733c9a
    • Neel Goyal's avatar
      Fix issue when reading more than 2GB · 07d59092
      Neel Goyal authored
      Summary: If performRead is called with bufLen > 2GB then overflow occurred with the value passed to SSL_read.  We'll clamp it here. This should be fine since performRead will be called again as there is more data to read.
      
      Reviewed By: andriigrynenko, knekritz, mingtaoy
      
      Differential Revision: D15625000
      
      fbshipit-source-id: 8633686a76baebd796139f3b20c6f7286339fd96
      07d59092
    • Kyle Nekritz's avatar
      Return 1 on success in OPENSSL_init_ssl compatibility implementation. · 6c11bbdc
      Kyle Nekritz authored
      Summary: Exposed by D15610738.
      
      Reviewed By: ngoyal
      
      Differential Revision: D15622920
      
      fbshipit-source-id: f3058c69098ae740d43f27e8161e99b3c5a6b995
      6c11bbdc
    • Matthieu Martin's avatar
      Simplify doSetContextData · fd879f06
      Matthieu Martin authored
      Summary:
      The main change is to grab a wlock in doSetContextData, which enables to make the code more readable, and (insignificantly) more efficient.
      
      Grabbing the wlock directly is also strictly better for both `set` and `override`.
      `setIfAbsent` is the only one to potentially suffers from the lock change, in the case where it already exists. But `setIfAbsent` isn't used by either of the guards, which are the recommended way of changing values in RequestContext. So it seems incorrect to optimize for it, and overkill to fork the code.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D15604768
      
      fbshipit-source-id: 44f564b09ff50e8bfe0e1c4cf5ee2d77b654e929
      fd879f06
    • Orvid King's avatar
      Add a basic utility for checked addition of unsigned integers · c79ac334
      Orvid King authored
      Summary: A very basic function that if done incorrectly will get optimized away as undefined behavior. For now keep things simple and only support addition of unsigned values.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D15609542
      
      fbshipit-source-id: 70d5fde784f57d3d52e6122352a885d7a835f104
      c79ac334
    • Yedidya Feldblum's avatar
      Fix SerialExecutor task destruction order · da3a4406
      Yedidya Feldblum authored
      Summary: [Folly] Fix SerialExecutor task destruction order where tasks are destroyed outside of the request-context scope.
      
      Reviewed By: andriigrynenko
      
      Differential Revision: D15618395
      
      fbshipit-source-id: e2ec8e42137d14f549f92dbc96a904eadcc0a587
      da3a4406
    • REDMOND\acoates's avatar
      Allow building x86 and arm on msvc (#1147) · 436efbfe
      REDMOND\acoates authored
      Summary:
      A couple of changes to support building folly in MSVC/win32 for x86 and arm platforms.
      Pull Request resolved: https://github.com/facebook/folly/pull/1147
      
      Reviewed By: Orvid
      
      Differential Revision: D15592309
      
      Pulled By: yfeldblum
      
      fbshipit-source-id: 97860ab9309e5492bfadac56079af735741d4a2c
      436efbfe
    • Mingtao Yang's avatar
      Fail early in folly::ssl::init() if we can't initialize · f8b36eab
      Mingtao Yang authored
      Reviewed By: yfeldblum
      
      Differential Revision: D15610738
      
      fbshipit-source-id: 367919db6465536e215735400652d33290930ca0
      f8b36eab
    • Stiopa Koltsov's avatar
      folly/string: better strerror_r detection · fa3eb5b1
      Stiopa Koltsov authored
      Summary:
      There are two variants of `strerror_r` function, one returns
      `int`, and another returns `char*`. Selecting proper version using
      preprocessor macros portably is extremely hard.
      
      For example, on Android function signature depends on `__USE_GNU` and
      `__ANDROID_API__` macros (https://git.io/fjBBE).
      
      So we are using C++ overloading trick: we pass a pointer of
      `strerror_r` to `invoke_strerror_r` function, and C++ compiler
      selects proper function.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D15484722
      
      fbshipit-source-id: fc0bd45fa67dc401631ffc185c9fad231e4a48a0
      fa3eb5b1