- 01 Mar, 2016 5 commits
-
-
Christopher Dykes authored
Summary: I missed these in my initial diff. Reviewed By: yfeldblum Differential Revision: D2989977 fb-gh-sync-id: 0efb92286a8aed91ec1d394572cd709e5b6b37ab shipit-source-id: 0efb92286a8aed91ec1d394572cd709e5b6b37ab
-
Dave Watson authored
Summary:Changed from size_t to unsigned in a recent tp2 update https://github.com/jemalloc/jemalloc/blame/3c07f803aa282598451eb0664cc94717b769a5e6/test/unit/mallctl.c Reviewed By: jasone, mhlakhani Differential Revision: D2991755 fb-gh-sync-id: 46f2be722a30706333eac6428f4183ca9cb85543 shipit-source-id: 46f2be722a30706333eac6428f4183ca9cb85543
-
Michael Lee authored
Summary: Also remove an extra `#include <strstream>` from JsonTest.cpp as it is no longer necessary. Reviewed By: yfeldblum Differential Revision: D2991381 fb-gh-sync-id: 386b8281726d034933ebdc26733dd35dc5ace949 shipit-source-id: 386b8281726d034933ebdc26733dd35dc5ace949
-
Michael Lee authored
Summary: We do not need this main function, so remove it. Reviewed By: markisaa Differential Revision: D2992000 fb-gh-sync-id: 30bc0734af0f61e047276dab9639ae29cc999bbb shipit-source-id: 30bc0734af0f61e047276dab9639ae29cc999bbb
-
Subodh Iyengar authored
Summary:previously we were not able to do Future<Base> f = makeFuture<Derived>(); This is because Future did not declare a conversion constructor. Adding a proper conversion ctor for Future is very tricky because of the way Core is managed under the hood. Core is not movable, and cannot be moved otherwise we would have to retain pointers to the Future and Promises which pointed to a particular core. This would be inefficient. Instead we compromise and allow a very small subset of conversions from objects whose templated types are convertible and also the sizes of their Cores are also the same. As a result, we can convert between types like unique_ptrs however not always between full objects. Reviewed By: jsedgwick Differential Revision: D2943775 fb-gh-sync-id: 7c2388f2fb49d789c80ae2477814e960a099771b shipit-source-id: 7c2388f2fb49d789c80ae2477814e960a099771b
-
- 29 Feb, 2016 1 commit
-
-
Pavlo Kushnir authored
Summary: it's really thread local at this point :) Reviewed By: jmswen Differential Revision: D2989668 fb-gh-sync-id: 423b9214922c92318181a62c583f58cd204b52e3 shipit-source-id: 423b9214922c92318181a62c583f58cd204b52e3
-
- 27 Feb, 2016 1 commit
-
-
Scott Wolchok authored
Summary:Found this hunting down LockFreeRingBuffer iOS perf problems. `wfe` and `yield` are similar, but `yield` is the instruction meant for "hey, I'm doing a spinlock", whereas `wfe` tries to wait for certain processor events. See http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0204j/Cjafcggi.html Conveniently, it's the same instruction on 32-bit and 64-bit ARM. Reviewed By: yfeldblum Differential Revision: D2986160 fb-gh-sync-id: 34671256112e605bf857f9db54a56cf6bb6f1ee2 shipit-source-id: 34671256112e605bf857f9db54a56cf6bb6f1ee2
-
- 26 Feb, 2016 2 commits
-
-
Andrii Grynenko authored
Summary:This re-uses StaticSingletonManager which was previously used to fix the same issue in folly::Singleton. Because of the same issue we can no longer use static thread_local for the ThreadEntry. We now rely on pthread_getspecific/pthread_setspecific instead and use static thread_local ThreadEntry* only as a cache (to improve perf). Reviewed By: yfeldblum Differential Revision: D2978526 fb-gh-sync-id: cf1d9044afc27b62bd50a1ed931c0c420ae7107e shipit-source-id: cf1d9044afc27b62bd50a1ed931c0c420ae7107e
-
Christopher Dykes authored
Summary: Windows doesn't have it. Reviewed By: yfeldblum Differential Revision: D2979215 fb-gh-sync-id: 030bdcaa44deb18834903705a26369ce0b13abc6 shipit-source-id: 030bdcaa44deb18834903705a26369ce0b13abc6
-
- 25 Feb, 2016 7 commits
-
-
Michael Lee authored
Summary:Split up io/test/IOBufCursorTest test/BitsTest test/CacheLocalityTest test/CallOnceTest test/ConvTest test/LoggingTest test/MemoryIdlerTest test/RandomTest test/ThreadLocalTest Reviewed By: yfeldblum Differential Revision: D2973132 fb-gh-sync-id: 9dadbdf49a31e82c3a2e34c2fdb6a2b47aa0928d shipit-source-id: 9dadbdf49a31e82c3a2e34c2fdb6a2b47aa0928d
-
Michael Lee authored
Summary: FileTest pulls in subprocess and does a lot more than just directly test File.h Reviewed By: yfeldblum Differential Revision: D2971641 fb-gh-sync-id: 16e1096ab3b0f6434a26f84c889ebb082ee3f210 shipit-source-id: 16e1096ab3b0f6434a26f84c889ebb082ee3f210
-
Christopher Dykes authored
Summary:Because `extern char** environ` is not the correct way to access environ on Windows. This also implements setenv and unsetenv for Windows, which means that TestUtils no longer needs to be disabled for the Windows build. Reviewed By: mzlee Differential Revision: D2973704 fb-gh-sync-id: 84db7db3494cf183fcbcc25063cb0482ef84ebf4 shipit-source-id: 84db7db3494cf183fcbcc25063cb0482ef84ebf4
-
Nathan Bronson authored
Summary:New ASAN options are more thorough but slower, resulting in timeouts for some tests. Decreasing their internal loop count to compensate. Reviewed By: yfeldblum Differential Revision: D2973982 fb-gh-sync-id: 67391936d0b4930f99d00358ebb93a1b3ee87140 shipit-source-id: 67391936d0b4930f99d00358ebb93a1b3ee87140
-
Jonathan Kron authored
Summary: Both of these tests will unavoidably fail on ASan because of shared library loads, and indestructable objects. Disabling ASAN testing for these test files. Reviewed By: yfeldblum Differential Revision: D2968169 fb-gh-sync-id: d2acc71b40541af5e10f15d5087a7c07da05453d shipit-source-id: d2acc71b40541af5e10f15d5087a7c07da05453d
-
Christopher Dykes authored
Summary:MSVC doesn't let you have unicode characters in a narrow string without using a utf-8 literal string. AsyncTransport needs the definition of IOBuf because of how the standard library implements a few things. And longs are only 32-bit under Windows. Reviewed By: yfeldblum Differential Revision: D2973973 fb-gh-sync-id: c2f3e848e740a65c575598991d43dd79360ec1e3 shipit-source-id: c2f3e848e740a65c575598991d43dd79360ec1e3
-
Orvid King authored
Summary:Because sometimes things are just different. MSVC warns about the `dynamic_cast` done against this class because the class's declaration doesn't show that it would need a vtordisp. While I don't believe the `dynamic_cast` in question is actually called in either the constructor or destructor paths for the class, better to be safe and force the disp to be created. Reviewed By: yfeldblum Differential Revision: D2887490 Pulled By: Orvid fb-gh-sync-id: 821a6fc820087ac7120fffd9f8b95a26c2b4e71b shipit-source-id: 821a6fc820087ac7120fffd9f8b95a26c2b4e71b
-
- 24 Feb, 2016 3 commits
-
-
Sven Over authored
Summary:Callbacks passed to e.g. folly::Future::then (or folly::Future::ensure) may delete the promise that keeps the Core of the same future alive. The Core must protect itself from destruction during callback execution. This commit also adds a unit test to check for correct behaviour in the "self destruction" scenario. The test should usually pass even without the fix in Core.h. However, when you run the test in Valgrind or ASAN, it will report problems unless the fix in Core.h is applied. Reviewed By: mhx Differential Revision: D2938094 fb-gh-sync-id: 22796e168e1876ef2e3c7d7619da020be6a22073 shipit-source-id: 22796e168e1876ef2e3c7d7619da020be6a22073
-
Andrii Grynenko authored
Summary: Allow createGlobal() to create dependent objects. Reviewed By: yfeldblum Differential Revision: D2963111 fb-gh-sync-id: 8e4da48a7a1000934963396b423e8eff98a8aade shipit-source-id: 8e4da48a7a1000934963396b423e8eff98a8aade
-
Yedidya Feldblum authored
Summary:[Folly] Fix Build: `folly/test/IndestructibleTest.cpp` under LSAN. Leaks of Meyers singletons are ignored automatically, while normal locals are not. So we make our instances be Meyers singletons. Differential Revision: D2968368 fb-gh-sync-id: 385ac4491d9a105885af82d85354af929d69cc80 shipit-source-id: 385ac4491d9a105885af82d85354af929d69cc80
-
- 23 Feb, 2016 4 commits
-
-
Andrii Grynenko authored
Summary: Use Meyers singleton instead. Reviewed By: afrind Differential Revision: D2963282 fb-gh-sync-id: 7aec36e7cc3b0ab09b2b093202f40d5b0d399f4d shipit-source-id: 7aec36e7cc3b0ab09b2b093202f40d5b0d399f4d
-
Beny Luo authored
Summary: AsyncSocketException: add detailed information in error message Reviewed By: yfeldblum Differential Revision: D2953030 fb-gh-sync-id: a5e26036657ecc6c74ad0369650730a2af13bead shipit-source-id: a5e26036657ecc6c74ad0369650730a2af13bead
-
Michael Lee authored
Summary:Benchmarks need their own main function, which means they aren't really useful in cases we can't use a custom main function. Reviewed By: yfeldblum Differential Revision: D2962104 fb-gh-sync-id: 25bdc6e5a8bdf8c3aa94d393207a74797b2e1234 shipit-source-id: 25bdc6e5a8bdf8c3aa94d393207a74797b2e1234
-
Lucian Grijincu authored
Summary:Presence of .debug_aranges implies user expects fast address lookup. Some addresses might not be avaialble in .debug_aranges. Don't do slow lookup in .debug_info, as it can lead to unexpected slowdowns. override-unit-failures Reviewed By: philippv Differential Revision: D2965323 fb-gh-sync-id: 405daefd57cdff4344fd231c5f5b7ff4dcd9df8c shipit-source-id: 405daefd57cdff4344fd231c5f5b7ff4dcd9df8c
-
- 22 Feb, 2016 3 commits
-
-
Neel Goyal authored
Summary: Fixed the build using the homebrew instructions Reviewed By: yfeldblum Differential Revision: D2960409 fb-gh-sync-id: 218b879f26b3baab09676cac51787bf36d0b4bed shipit-source-id: 218b879f26b3baab09676cac51787bf36d0b4bed
-
Nathan Bronson authored
Summary:This diff moves all data accessed during AccessSpreader<>::current(x) into the .data segment, avoiding SIOF without adding indirection or dynamic gating as would be the case for normal singleton-like constructs. The diff also trims the AccessSpreader API to include only those methods that people actually seem to use. Reviewed By: djwatson Differential Revision: D2945205 fb-gh-sync-id: 847e31adc4450217f4ed0575686be261fb504d7c shipit-source-id: 847e31adc4450217f4ed0575686be261fb504d7c
-
Michael Lee authored
Summary: test/common/TestMain.cpp should provide the necessary initialization. Reviewed By: yfeldblum Differential Revision: D2947245 fb-gh-sync-id: 75b9d241673667badf4dc8fb81285c60cbb8166a shipit-source-id: 75b9d241673667badf4dc8fb81285c60cbb8166a
-
- 20 Feb, 2016 2 commits
-
-
Andrii Grynenko authored
Summary: All singleton registration has to happen in .cpp. Otherwise singleton may be double registered if inlined. Reviewed By: yfeldblum Differential Revision: D2956951 fb-gh-sync-id: bea425c31270d614f4b8a780204694168602fe86 shipit-source-id: bea425c31270d614f4b8a780204694168602fe86
-
Andrii Grynenko authored
Summary:It's possible to have nested loopUntilNoReady (with different FiberManagers). See unit test for a simple example. This diff fixes currentFiberManager_ to be a stack. Reviewed By: meyering Differential Revision: D2953468 fb-gh-sync-id: 0abdcb7f43c94e7bb0adef8440699dc8e138d21a shipit-source-id: 0abdcb7f43c94e7bb0adef8440699dc8e138d21a
-
- 19 Feb, 2016 6 commits
-
-
Andrii Grynenko authored
Summary: EventBase loop should do it as well, but it's possible for LoopCallback to be removed before EventBaseOnDestructionCallback. Reviewed By: pavlo-fb Differential Revision: D2951303 fb-gh-sync-id: 43f5a91e7ecffa7ab7feec32fa45e01b28db66a3 shipit-source-id: 43f5a91e7ecffa7ab7feec32fa45e01b28db66a3
-
Andrii Grynenko authored
Summary:This implements StaticSingletonManager which is then used to create all leaked Meyers singletons. StaticSingletonManager is a singleton itself, which is created in a separate compilation unit (Singleton.cpp) and so we can be sure that other compilation units will always see a single instance of StaticSingletonManager, even if linked dynamically. StaticSingletonManager then keeps a dictionary of typeid -> object pointer, which is used to de-duplicate same singleton being re-created from different compilation units (linked dynamically), usually because of code inlining. override-unit-failures Reviewed By: yfeldblum Differential Revision: D2913027 fb-gh-sync-id: 1f5015a79a7a8297ebf5f0fe3fd0cc7eb44f706b shipit-source-id: 1f5015a79a7a8297ebf5f0fe3fd0cc7eb44f706b
-
Tianjiao Yin authored
Summary: `mask(numBits)` returns a temporary variable. After its lifetime ends, subbytes becomes a dangling pointer. Reviewed By: yfeldblum Differential Revision: D2953699 fb-gh-sync-id: 5d5a35716ecaa1b3d96edb5a459615756848b92f shipit-source-id: 5d5a35716ecaa1b3d96edb5a459615756848b92f
-
Yedidya Feldblum authored
Summary:[Folly] `Indestructible`. For when you need a Meyers singleton that will never be destructed, even at program exit. Good for large data structures with many heap allocations, as long as they have no behavior. No point in ever destructing them. HT: Proxygen, and Orvid. Reviewed By: andriigrynenko Differential Revision: D2947959 fb-gh-sync-id: 7dd1f725edf137ba81fbf4032a0819fd7c627261 shipit-source-id: 7dd1f725edf137ba81fbf4032a0819fd7c627261
-
Lucian Grijincu authored
folly: symbolizer: slow address->{file+line-number} lookup if `.debug_aranges` is missing (e.g. --strip-debug-non-line) Summary:Binaries linked with `gold` and `--strip-debug-non-line` don't have an `.debug_aranges` section We still want to map `address->{file+line-number}` to get nice stack traces even though this might be slower (linear search all compilation unit entries in `.debug_info`). Before: ``` $ # link with gold + --strip-debug-non-line $ folly/experimental/exception_tracer/exception_tracer_test E0217 15:02:13.694947 1321814 ExceptionTracer.cpp:179] Exception type: std::runtime_error (9 frames) @ 000000000040ad2d __cxa_throw @ 0000000000409df3 bar() @ 0000000000409eab baz() @ 0000000000407c77 main @ 00007f00dd9860f5 __libc_start_main @ 000000000040991b (unknown) ``` After (similar to the output without `--strip-debug-non-line`): ``` E0217 18:37:37.579596 1583124 ExceptionTracer.cpp:179] Exception type: std::runtime_error (9 frames) @ 000000000040ad6d __cxa_throw ./folly/experimental/exception_tracer/ExceptionTracerLib.cpp:57 @ 0000000000409e33 bar() ./folly/experimental/exception_tracer/ExceptionTracerTest.cpp:24 @ 0000000000409eeb baz() ./folly/experimental/exception_tracer/ExceptionTracerTest.cpp:51 @ 0000000000407c87 main ./folly/experimental/exception_tracer/ExceptionTracerTest.cpp:96 @ 00007f1d16ff80f5 __libc_start_main @ 000000000040995b (unknown) ``` Differential Revision: D2947965 fb-gh-sync-id: e517bab324b1dcb70cadc9a5211ce794e35c83a5 shipit-source-id: e517bab324b1dcb70cadc9a5211ce794e35c83a5
-
Christopher Dykes authored
Summary: MSVC is actually smarter about this than GCC, as MSVC doesn't support VLAs, it tries to eval the length at compile time. GCC on the other hand doesn't try to eval it at compile time, resulting in compiles via CMake telling us that this is a VLA. Reviewed By: yfeldblum Differential Revision: D2911929 fb-gh-sync-id: ffaa133bcf4129a3e02f7e875966d3ae6a97be6a shipit-source-id: ffaa133bcf4129a3e02f7e875966d3ae6a97be6a
-
- 18 Feb, 2016 2 commits
-
-
Sven Over authored
Summary:The existing implementation of folly::applyTuple does not support mutable callables (such as mutable lambdas and other functor objects that only implement non-const operator()). This commit adds a few more unit tests and changes the implementation so that new and existing tests pass. Reviewed By: yfeldblum Differential Revision: D2942622 fb-gh-sync-id: 82478f290e9fd2020358ff79ef0a6bcf8a43738c shipit-source-id: 82478f290e9fd2020358ff79ef0a6bcf8a43738c
-
Yedidya Feldblum authored
Summary:[Folly] Sort the `Makefile` headers a bit. Just manually moving a few obviously out-of-order entries. Reviewed By: Orvid Differential Revision: D2945668 fb-gh-sync-id: 604976d25e5913ef01d591e23737d61dacfbfc86 shipit-source-id: 604976d25e5913ef01d591e23737d61dacfbfc86
-
- 17 Feb, 2016 4 commits
-
-
Nathan Bronson authored
Reviewed By: djwatson Differential Revision: D2945770 fb-gh-sync-id: 9e4ee3b052b0bbb33ef796b8070edd24c6942589 shipit-source-id: 9e4ee3b052b0bbb33ef796b8070edd24c6942589
-
Lovro Puzar authored
Summary: std::call_once is a nice API but the current GCC implementation is slower than it needs to be. Adding a header-only wrapper with an additional atomic bool. Reviewed By: luciang Differential Revision: D2938884 fb-gh-sync-id: 5939c94fe62a1523053dcff26c880ecaec9e1150 shipit-source-id: 5939c94fe62a1523053dcff26c880ecaec9e1150
-
Michael Lee authored
Summary:--Perhaps this should move to Portability.h instead. There is another instance of this in io/async/AsyncSocket.cpp.-- Added `portability/SysUio.h` to handle the c-macro conversion into a usable value. Reviewed By: yfeldblum Differential Revision: D2940778 fb-gh-sync-id: 897e44b430c02e5a7d826f3e8da9e4979b7b898c shipit-source-id: 897e44b430c02e5a7d826f3e8da9e4979b7b898c
-
Anirudh Ramachandran authored
Summary: Minor changes to AsyncSSLSocket for async crypto Reviewed By: siyengar Differential Revision: D2516765 fb-gh-sync-id: 354baeb94e6f63e8d5cdf8455ff5ca49a6aa479c shipit-source-id: 354baeb94e6f63e8d5cdf8455ff5ca49a6aa479c
-