- 05 Feb, 2018 4 commits
-
-
Dave Watson authored
Summary: The refcounting logic is correct, however, decreasing the next node's refcount only happens in ~NodeT, after going through hazptr bulkReclaim. The current default for bulkReclaim is 1k, which exceeds the value of refcount uint8_t. Increase size to uint16_t so that we don't wrap refcount before bulkReclaim calls the node destructors. Reviewed By: magedm Differential Revision: D6900530 fbshipit-source-id: 9b2530dc6cd0609b4795b909fd46aeffbb1ae821
-
Adam Simpkins authored
Summary: Now that we have Travis CI builds enabled and passing, add a link to the build status to the README. Reviewed By: yfeldblum Differential Revision: D6903206 fbshipit-source-id: 643b72a63a4113e00ff1602b1c3638384115b23d
-
Petr Lapukhov authored
Summary: Allow retrieving sub-tree from folly::dynamic using JSON pointer syntax (RFC6901). This adds new overload for the `get_ptr` method, retrieving raw pointer to a sub-tree, or returning `nullptr` if element is not found. The `folly::dynamic` implementation traverses the path specified by JSON pointer string dynamically every time, since the underlying object may change, and JSON pointer traversal depends on the underlying object structure. E.g. "123" could be a key name for `dynamic::object` and index in `dynamic::array`. Reviewed By: yfeldblum Differential Revision: D6790515 fbshipit-source-id: bb6ea10acb83673e87721cf1e5a02506b44bb273
-
Igor Kobzar authored
Summary: Debian 8.6 comes with a CMake version that is too old for folly. Add commands to update cmake. Reviewed By: snarkmaster Differential Revision: D6842797 fbshipit-source-id: 22f4c407f82a92c3fa90a5c2de334cf8b92e584b
-
- 03 Feb, 2018 2 commits
-
-
Adam Simpkins authored
Summary: Unfortunately it looks like D6880256 was not sufficient to make function_scheduler_test pass reliably on Travis CI builds. This just disables function_scheduler_test on open source CMake-based builds for now. Ideally in the future we should try to convert most of the function scheduler to use proper synchronization mechanisms (like folly::Baton) for synchronizing between threads, rather than sleeping and expecting the other thread to have completed its work before we wake up. Reviewed By: yfeldblum Differential Revision: D6891889 fbshipit-source-id: 9ee98f5807e1d90f083bd942ba98df6fad656ba6
-
Adam Simpkins authored
Summary: The XLOG() macros compute the log category based on the source file name, as defined by `__FILE__`. Both gcc and clang set the `__FILE__` contents to the file name passed in on the command line, so if they are invoked with absolute path names `__FILE__` will contain an absolute path. This is normally undesirable for `XLOG()` behavior. Furthermore, CMake always invokes the compiler with absolute path names, so it is difficult to avoid this situation in open source builds. This adds support for a `FOLLY_XLOG_STRIP_PREFIXES` macro. This can be defined to a string containing a colon-separated list of directory prefixes to strip from `__FILE__` before using it to compute the log category name. If `FOLLY_XLOG_STRIP_PREFIXES` is not defined then the code continues to use `__FILE__` as-is. Reviewed By: yfeldblum Differential Revision: D6868773 fbshipit-source-id: a5c3276d8d22d3b27ae621700a75b1362d049292
-
- 02 Feb, 2018 13 commits
-
-
Adam Simpkins authored
Summary: Many of the tests in FunctionSchedulerTest appear to frequently fail on Travis CI builds. It looks like this is probably due to timing issues where events do not fire within the expected time interval. This diff increases the `timeFactor` value to hopefully make the tests more reliable, at the expense of making them take longer to run. It would be nicer if we had a better solution here that did not involve potentially unreliable timing-dependent checks. Increasing `timeFactor` seems like the easiest solution in the short-term though, and avoids just disabling the tests entirely. Reviewed By: yfeldblum Differential Revision: D6880256 fbshipit-source-id: 59da3b20f2bb9c982834752942a984e3f91442fd
-
Adam Simpkins authored
Summary: Most of the tests in FunctionSchedulerTest sleep for lengths of time based on the timeFactor constant set at the top of the file. However a couple of places that need to sleep for non-integral timeFactor durations used manual `usleep()` calls instead. This made the tests break if you change the `timeFactor` value. This changes `delay()` to accept floating point numbers, and updates the tests that were using hard-coded `usleep()` calls to use `delay()` instead. Reviewed By: yfeldblum Differential Revision: D6880258 fbshipit-source-id: 0cfdf84d3ba27aa2acd1f5210becbc7306b857bf
-
Adam Simpkins authored
Summary: Most of the tests in FunctionSchedulerTest update a variable in one thread (the FunctionScheduler thread) and then check its value in the main thread. These previously were not using any synchronization between the threads. This fixes them to use `std::atomic` to ensure proper synchronization. Reviewed By: wez Differential Revision: D6880254 fbshipit-source-id: facfbdf06312f731c64389fb4382b5cb078b76b9
-
Flarnie Marchan authored
Summary: Hi! I noticed this repo could use some documentation to help new contributors. **why make this change?:** Regarding the `CONTRIBUTING.md` -> Including instructions for new contributors to open source is a courtesy that will foster a welcoming and safe open source community at Facebook. Regarding the Code of Conduct -> Facebook Open Source provides a Code of Conduct statement for all projects to follow, to promote a welcoming and safe open source community. Exposing the COC via a separate markdown file is a standard being promoted by Github via the Community Profile in order to meet their Open Source Guide's recommended community standards. As you can see, adding this file will improve [the folly community profile](https://github.com/facebook/folly/community) checklist and increase the visibility of our COC. Closes https://github.com/facebook/folly/pull/719 Reviewed By: flarnie Differential Revision: D6881011 Pulled By: simpkins fbshipit-source-id: a6f0988ac2b49f81bb13d3219095105b7b27e66f
-
Adam Simpkins authored
Summary: Add a constexpr implementation of `strcmp()` Reviewed By: yfeldblum Differential Revision: D6881816 fbshipit-source-id: 08a9e5ab9ef4a422ff6d004ec13b8ec8c71b0d6f
-
Adam Simpkins authored
Summary: - Use `FOLLLY_HAS_FEATURE(cxx_constexpr_string_builtins)` to check for the availability of `__builtin_strlen()` on clang, as recommended by the clang documentation (https://clang.llvm.org/docs/LanguageExtensions.html) - Only use `std::strlen()` on gcc, rather than having checks to exclude all other compilers. `strlen()` happens to be constexpr on gcc, but this is not required by the standard and cannot be assumed to be true in general. Reviewed By: yfeldblum Differential Revision: D6881815 fbshipit-source-id: 88c614419ae390464893087513dc764b0bfddfb8
-
Michael Lee authored
Summary: This test has been failing in travis because it is missing test/certs/tests-cert.pem Mark it as a content dir Reviewed By: yfeldblum Differential Revision: D6884000 fbshipit-source-id: c7d42a4b23334781de28f1586ecbde04aea74ff2
-
Adam Simpkins authored
Summary: Update the build steps in the README to build using cmake instead of autoconf on Linux platforms. I haven't updated the instructions for Mac OS X or the `bootstrap-osx-homebrew.sh` script primarily because I have not tested the steps on Mac. It sounds like the build is close to working on Mac, but currently fails due to missing compiler flags to disable some warnings on clang. Reviewed By: akushner Differential Revision: D6780814 fbshipit-source-id: 9c9c211c306d5b35235549ae451bb620098f37e3
-
Adam Simpkins authored
Summary: Update the CMake build process to always invoke test programs from the root of the repository. This makes the CMake build consistent with how we run tests internally at Facebook. Reviewed By: yfeldblum Differential Revision: D6880257 fbshipit-source-id: 4c27cc643faa21d9c26faf8c77f6700ec5fe6393
-
Lee Howes authored
Summary: DeferredExecutor suffered from a case where boosting would not work if no work was present. This change modifies is so that on a call to via the next executor will be set in the DeferredExecutor. When add is called the callback will be stored. Whichever happens second actually enqueues the work on the chained executor. get uses via to correctly implement this. Reviewed By: andriigrynenko Differential Revision: D6663244 fbshipit-source-id: 74600d511373e0f6f7ca4128f25f3947a4981200
-
Michael Lee authored
Summary: Android also has limited support for thread_local so we should not enable it at all as a precaution Reviewed By: magedm Differential Revision: D6884145 fbshipit-source-id: f39dd8fd5405ca0bc5be9b3538718a6f58058442
-
Andrii Grynenko authored
Summary: Make EventBaseLoopController not dependent on EventBase's runOnDestruction. This will allow us to make FiberManager work with any Executor. Reviewed By: yfeldblum Differential Revision: D6828478 fbshipit-source-id: 4d74776044a02954d022ef6f6f1e6834839973b8
-
Adam Simpkins authored
Summary: FunctionSchedulerTest.cpp was unfortunately copied into folly twice in separate locations. D1845525 moved it into `folly/test`, D2051557 moved it into `folly/experimental/test` The version in `folly/experimental/test` has had several updates and new tests added; the version in `folly/test` has had no significant changes since it was first added. This diff deletes the older copy in `folly/test` Differential Revision: D6880255 fbshipit-source-id: 8a4d5f6421ec18b319ffd76f98915e925b407468
-
- 01 Feb, 2018 12 commits
-
-
Michael Lee authored
Summary: Sometimes the compiler lies to us and says it supports thread_local when it is not always fully implemented. Unconditionally disable this when `FOLLY_MOBILE` is set Reviewed By: yfeldblum Differential Revision: D6875230 fbshipit-source-id: 051f79eac78da03973bad9090b6577393b88998b
-
Adam Simpkins authored
Summary: Disable running the async_test in open source builds. A few of the tests functions in this binary are flaky. Additionally, this test consistently hangs in Travis CI builds. It hangs in `AsyncSocketTest.ServerAcceptOptions`; I suspect it never sees the socket accept event and therefore never breaks out of the loop. I suspect that even if we fixed this test other subsequent tests would also hang. We should ideally update all of the tests to always have their own internal event base loop timeout rather than potentially looping forever, so it could at least run other test functions after a hang like this. Reviewed By: yfeldblum Differential Revision: D6874011 fbshipit-source-id: 46c07a1cf3216eda1900e214447e6e49b6c8e489
-
Yedidya Feldblum authored
Summary: [Folly] Move `invoke` helpers into a special detail namespace. So that code in `namespace folly::detail` can use `invoke_result`, etc., unqualified. Reviewed By: aary Differential Revision: D6869406 fbshipit-source-id: 1b0ebbfb16621cf7e32c0f89162a19410a70605a
-
Adam Simpkins authored
Summary: Update our continuous integration configuration files to invoke ctest with the `--output-on-failure` flag so it will print the output of all tests that fail. Without this flag it is rather difficult to debug test failures in CI. Reviewed By: yfeldblum Differential Revision: D6869299 fbshipit-source-id: 02d2e1ac03f786034b20797d02e9c3aa64c1b30b
-
Uddipta Maity authored
Summary: #title Reviewed By: yfeldblum Differential Revision: D6864158 fbshipit-source-id: 13c98c3e44db6febae844f099baa9fbecc9db673
-
Adam Simpkins authored
Summary: Change some `EXPECT_EQ()` statements to `EXPECT_TRUE()` and `EXPECT_FALSE()`. This was causing compilation failures on some gcc-4.9 platforms. Reviewed By: yfeldblum Differential Revision: D6869102 fbshipit-source-id: c3294eeca90130fec601c60a76cfa4dc1bc81639
-
Maged Michael authored
Summary: Removed instances of logging reclaim_ Reviewed By: mzlee Differential Revision: D6864752 fbshipit-source-id: d36205052799d2307e1cd6a0307c094ac3fa8b26
-
Adam Simpkins authored
Summary: Various folly tests failed to compile when using the older gcc-4.9 version. Since we apparently want to keep supporting gcc-4.9 for a bit longer, update the code so that it can be compiled with gcc-4.9. Reviewed By: yfeldblum Differential Revision: D6817546 fbshipit-source-id: a5224560330b49e94e10d21f81a83538ec7f34e9
-
Adam Simpkins authored
Summary: Add fbcode_builder configs for folly to folly/build. Reviewed By: yfeldblum Differential Revision: D6700053 fbshipit-source-id: 3b9e974f727e7b7815580d8a12a6adfc3b529866
-
Adam Simpkins authored
Summary: The code in PriorityThreadFactoryTest.ThreadPriority attempted to set the thread niceness to 1. This would fail if the process was already running at a higher niceness value and was not being run as root. This updates the test to get the current niceness first, and to use that plus 1 as the niceness value to change to. Reviewed By: yfeldblum Differential Revision: D6817548 fbshipit-source-id: 80e740f1fbe751865a418a58081bde4086b21679
-
Adam Simpkins authored
Summary: Update the ExceptionWrapperTest to check typeid strings against the result of calls to `demangle()`, rather than expecting `typeid(int)` to always be demangled as the string "int". When building with gcc-7.2 on Ubuntu 17.10 these type strings appear to be demangled simply as "i". Reviewed By: yfeldblum Differential Revision: D6817545 fbshipit-source-id: 134952106ad812f6980516247081bb9718b5ab38
-
Adam Simpkins authored
Summary: Update folly's TestMain program to enable glog logging to stderr by default. Some of the tests in folly/experimental/test/TestUtilTest.cpp require that this is enabled, and fail if log messages are not logged to stderr. Reviewed By: yfeldblum Differential Revision: D6817543 fbshipit-source-id: 87724c52124e72ad19f65524bcbd6536680f02ec
-
- 31 Jan, 2018 9 commits
-
-
Lee Howes authored
Rename hazptr DEBUG_PRINT macro to HAZPTR_DEBUG_PRINT to avoid name clashes with other uses in code. Reviewed By: yfeldblum, magedm Differential Revision: D6863117 fbshipit-source-id: 1626eacafbdddcfdaf181b2a5d0f6e216425b1ff
-
Adam Simpkins authored
Summary: Drop instructions for building on Ubuntu 12.04, 13.10, and 14.04. The oldest Ubuntu platform we support these days is 16.04. Our Travis CI configurations do still test building on Ubuntu 14.04 for now, but it is not a vanilla 14.04 installation. We upgrade gcc to 4.9 and CMake to 3.2 in order to build folly on this older Ubuntu version. Reviewed By: yfeldblum Differential Revision: D6780815 fbshipit-source-id: 0d27cdbb928d32c1527623c8862d50ce2215dd48
-
Joe Loser authored
Summary: Fix a few unused parameters. One was unconditional; the other two are conditional based on some configuration values set during CMake configure time. Closes https://github.com/facebook/folly/pull/747 Reviewed By: djwatson Differential Revision: D6858958 Pulled By: yfeldblum fbshipit-source-id: acb7fa5a79b9abfdf3dc210f649d0dea8ca4a87a
-
Yedidya Feldblum authored
Summary: [Folly] Generate group varint tables at compile time in C++, rather than as a separate custom build step in Python. Reviewed By: simpkins Differential Revision: D6832563 fbshipit-source-id: fa218c512cbac383f153e7b6fd4df7f181bcb0de
-
Yedidya Feldblum authored
Summary: [Folly] Generate format tables at compile time in C++, rather than as a separate custom build step in Python. Reviewed By: ot Differential Revision: D6830372 fbshipit-source-id: 25770676e59c8070eaef7cbb691a5ba1c4b0a8f8
-
Yedidya Feldblum authored
Summary: [Folly] Generate format tables at compile time in C++, rather than as a separate custom build step in Python. Reviewed By: ot Differential Revision: D6829681 fbshipit-source-id: 160b5a7616b015cc37ff389adabfec095cf136ec
-
Lee Howes authored
Summary: Fleshes out the SemiFuture API with waiting versions of xVia calls that take a TimedDrivableExecutor that can be driven until some time point. Reviewed By: yfeldblum Differential Revision: D6658862 fbshipit-source-id: 74906d8101d2a762a27da1a1ec8348f106037f5d
-
Yedidya Feldblum authored
Summary: [Folly] Use `invoke` in `applyTuple` implementation. V.s. reimplementing `invoke` as `makeCallable` Reviewed By: spacedentist Differential Revision: D6843993 fbshipit-source-id: 82f3e121486972245b75f808654d0a1299b7eafe
-
Yedidya Feldblum authored
Summary: [Folly] Fix missing "last-minute-reprieve" load-acquire in `Baton` and `SaturatingSemaphore`. If the CAS fails, it is because `post` with its store-release was invoked just after spinning but just before parking the thread. So the failure load needs a matching load-acquire. We cannot actually move the load-acquire into the CAS until C++17, since the failure memory order must be not stronger than the success memory order until C++17. Therefore, simulate the effect with an acquire fence in the CAS failure case. The CAS success case does not need a load-acquire; there is already a load-acquire after the thread is unparked. Reviewed By: davidtgoldblatt Differential Revision: D6851304 fbshipit-source-id: a43243ad6a35bd9a53a9d2a5958b50a6c8806419
-