1. 22 Apr, 2017 1 commit
    • Michael Lee's avatar
      Also exclude the wstring test · 3bdf6ef1
      Michael Lee authored
      Summary: ^^^
      
      Reviewed By: yangchi
      
      Differential Revision: D4934455
      
      fbshipit-source-id: babf56f4705ae06f46b694df3f2890d4b9506861
      3bdf6ef1
  2. 21 Apr, 2017 3 commits
    • Michael Lee's avatar
      Turn off failing FBString test for Android · 5b978faa
      Michael Lee authored
      Summary: The traitsLength call in the basic_fbstring constructor is returning a bad value.
      
      Reviewed By: Orvid
      
      Differential Revision: D4930106
      
      fbshipit-source-id: 556a61c4496c2af91cb70db6d62cdc7e915edd55
      5b978faa
    • Christopher Dykes's avatar
      Use std::nullptr_t in dynamic · 09887be9
      Christopher Dykes authored
      Summary: It was changed to a `void*` previously due to an ICE in GCC 4.7. GCC 4.7 hasn't been supported in quite a while, and newer versions of GCC don't crash, so it's time to switch it back to `nullptr_t`.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D4917389
      
      fbshipit-source-id: fc48642026c7e3aaeadef27bb949f70648c2312c
      09887be9
    • Cameron Pickett's avatar
      Fix issue where compiler cannot determine address of ::free at compile time · 58006ffb
      Cameron Pickett authored
      Reviewed By: Orvid
      
      Differential Revision: D4921738
      
      fbshipit-source-id: 69848cda3638fca4ead73dcc9949af0f600f33bb
      58006ffb
  3. 20 Apr, 2017 2 commits
    • Andrii Grynenko's avatar
      EventBaseLocal cleanup · 7de5a995
      Andrii Grynenko authored
      Summary:
      1. Restrict EventBaseLocal API to only be used from EventBase thread to avoid extra locking.
      2. Make sure objects stored in EventBaseLocal are destroyed in EventBase thread.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D4918282
      
      fbshipit-source-id: b7cb4c2b62fef85a9b1d796fa71af8af9087479d
      7de5a995
    • Nicholas Ormrod's avatar
      Remove unpackHack from smallVector · 049e3d99
      Nicholas Ormrod authored
      Summary:
      This change removes the unpackHack function from small_vector, which was blocking ##-Waddress-of-packed-member## from being enabled. The fix is split the pointer-getting non-const ##getCapacity## into a normal getter and setter.
      
      (lithium is flakey, according to continuous, and is push-blocking)
      
      Reviewed By: yfeldblum
      
      Differential Revision: D4918188
      
      fbshipit-source-id: 435e030ad659f5dc9c42d90e9bfee9ca564a120a
      049e3d99
  4. 19 Apr, 2017 3 commits
    • Maxim's avatar
      Added pkg-config as required dependency · c6cf2b08
      Maxim authored
      Summary:
      Faced this problem on Ubuntu 14.04.4 LTS
      
      ```
      configure:16581: error: possibly undefined macro: AC_MSG_NOTICE
            If this token and others are legitimate, please use m4_pattern_allow.
            See the Autoconf documentation.
      autoreconf: /usr/bin/autoconf failed with exit status: 1
      ```
      Fixed with `apt-get install pkg-config`
      Closes https://github.com/facebook/folly/pull/579
      
      Reviewed By: yfeldblum
      
      Differential Revision: D4886216
      
      Pulled By: Orvid
      
      fbshipit-source-id: 88159b70bfcf62d01bef502b3a5da6c9d81499bc
      c6cf2b08
    • Phil Willoughby's avatar
      Improve string comparisons · 5a122efc
      Phil Willoughby authored
      Summary:
      Any pair of read-compatible (same type, same traits) basic_strings (`basic_fbstring` or `std::basic_string`) can now be compared to each other with the `==`, `!=`, `<`, `>`, `<=`, and `>=` operators.
      
      If you have a C++14 environment this allows you to use the heterogeneous comparison lookup methods from N3657: you can query containers which store either string type with either string type efficiently.
      
      Reviewed By: yfeldblum, ot
      
      Differential Revision: D4905697
      
      fbshipit-source-id: 2ea976ebf40af45d64c1d8c1c08847feb3b9db68
      5a122efc
    • Andrew Krieger's avatar
      Include <strings.h> in portability/String.h · 14c1d806
      Andrew Krieger authored
      Summary:
      portabilty/String.h defines functions for Windows which
      are provided by <strings.h> on other platforms, but doesn't include
      <strings.h> in that case.
      
      Reviewed By: Orvid
      
      Differential Revision: D4908770
      
      fbshipit-source-id: b3326f78509c2aa1acb9c9279f01537b0a243400
      14c1d806
  5. 18 Apr, 2017 5 commits
  6. 17 Apr, 2017 2 commits
    • Christopher Dykes's avatar
      Don't invoke undefined behavior when getting the pthread_t out of std::thread::id · 43c0c2c5
      Christopher Dykes authored
      Summary: This assumes I understand strict-aliasing rules correctly.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D4900118
      
      fbshipit-source-id: edba535d3ba799ac665d3f859dc4154b2c1b22cb
      43c0c2c5
    • Maxim Georgiev's avatar
      Allow error message callback cancellation regardless of socket state. · 532b8c01
      Maxim Georgiev authored
      Summary: We should be able to reset error message callback in AsyncSocket evein if the socket is closed yet. It's common to keep callback installed while the socket is connected. Once the socket is closed, the deinitialization process starts. If the callback callee component gets deallocated before the socket object is deallocated, it should be able to cancel callbacks.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D4897335
      
      fbshipit-source-id: 8eee26f9ebcb78a01d55598be3aff6595a3ed852
      532b8c01
  7. 16 Apr, 2017 1 commit
    • Angelo Failla's avatar
      `IPVAddressV(46)::fromInverseArpaName` static methods · 5da6f8de
      Angelo Failla authored
      Summary:
      In a previous diff I added toInverseArpaName methods but I forgot to add the
      inverse. This change adds `IPVAddressV(46)::fromInverseArpaName` static methods.
      I have also implemented some suggestions that were in D4867502 but I couldn't
      incorporate because the diff was landed already.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D4885198
      
      fbshipit-source-id: b95752aa695d6675cb293f8df2daa1787383390f
      5da6f8de
  8. 15 Apr, 2017 4 commits
    • Eric Niebler's avatar
      replace #include <ios> in FBString.h with lighter #include <iosfwd> · ab7561be
      Eric Niebler authored
      Summary:
      FBString.h doesn't really use any of the facilities defined in <ios>, such as the stream manipulators. No sense dragging it into FBString.h.
      
      This could potentially break downstream users if they are not already including the io facilities they are using. It's unlikely though because the actual stream types (std::ostream, std::istream) and stream objects (std::cout, std::cin) are defined in other headers that #include <ios>.
      
      Reviewed By: yfeldblum, Orvid
      
      Differential Revision: D4886133
      
      fbshipit-source-id: 56adb93280eeeef8b09320b30fb224d4f72707bf
      ab7561be
    • Tudor Bosman's avatar
      Add exception_tracer to OSS build · 50708687
      Tudor Bosman authored
      Summary:
      What it says on the tin. Add the exception_tracer library to the folly OSS build, enabled with `--enable-exception-tracer`.
      Closes https://github.com/facebook/folly/pull/580
      
      Reviewed By: Orvid
      
      Differential Revision: D4895533
      
      Pulled By: yfeldblum
      
      fbshipit-source-id: 4878826c71e7d6af17845b23abc07dc48ea1aa51
      50708687
    • Christopher Dykes's avatar
      Add portability support for PThread's TLS API · 833ecbf0
      Christopher Dykes authored
      Summary:
      This is the last piece needed to get Folly working on Windows without PThreads.
      Updating Folly's test suite to support compiling without PThreads will come next.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D4894048
      
      fbshipit-source-id: 6076317e1364aef82a5d3cb306bea7c2226b3cdc
      833ecbf0
    • Christopher Dykes's avatar
      Remove unused local in OpenSSLCertUtils · 71c789bb
      Christopher Dykes authored
      Summary: It's unused, and MSVC is warning about that fact.
      
      Reviewed By: anirudhvr
      
      Differential Revision: D4894403
      
      fbshipit-source-id: 767b944eb9fa0376c795555357c09bbf9179e24f
      71c789bb
  9. 14 Apr, 2017 15 commits
    • Andrew Krieger's avatar
      Suppress more warnings for MSVC · b5e4bc03
      Andrew Krieger authored
      Summary:
      Several other warnings that aren't reasonable to disable globally occur in folly headers.
      
      - Wrap the unreachable code warnings in MSVC specific disable blocks to prevent problems for users.
      - Use more careful bit twiddling instead of negating unsigned types
      - Enable a simpler overload for bool->float conversion than one which attempts float->bool.
      - Delete one unneeded undef.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D4891583
      
      fbshipit-source-id: 4d2efda1fe720abcb083bf29b578c065127cda24
      b5e4bc03
    • Christopher Dykes's avatar
      Use folly::getCurrentThreadId() in SSLContext · bfdfe5e4
      Christopher Dykes authored
      Summary: Rather than duplicating logic (and #ifdefs), just call the helper function instead.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D4888362
      
      fbshipit-source-id: f5096f6029cf05526aa74bd40235ac8014824789
      bfdfe5e4
    • Christopher Dykes's avatar
      Make folly::getCurrentThreadId() return a thread ID on OSX · 9b2f7afe
      Christopher Dykes authored
      Summary: It was previously returning a pointer masquerading as a `uint64_t`.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D4888325
      
      fbshipit-source-id: 6cf6ed09f0e7a39a8a2f93d3fa14b06913c27805
      9b2f7afe
    • Christopher Dykes's avatar
      Add FOLLY_HAVE_PTRHEAD · 1244eb24
      Christopher Dykes authored
      Summary:
      Folly is gaining support for compiling without PThread support on Windows, but we need a way to know that at compile-time for certain APIs.
      This also includes changes to guard the only API outside of portability/PThread.h that needs to be guarded on the existence of PThread.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D4889526
      
      fbshipit-source-id: 21175ad90f60a47718c7e2775e3b429b2aad62e2
      1244eb24
    • Christopher Dykes's avatar
      Add support for building without PThread to the CMake files · b8d8ea5a
      Christopher Dykes authored
      Summary: Because, soon it won't be required.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D4892076
      
      fbshipit-source-id: 6bfbf5bf523262659c0af336f659398ae8545e50
      b8d8ea5a
    • Christopher Dykes's avatar
      Remove the old SpinLock implementations · 6226a991
      Christopher Dykes authored
      Summary: They aren't actually needed as the primary implementation is supported on all platforms.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D4882687
      
      fbshipit-source-id: 7208c5d3c1f35b29b0cabb6a20fe030fbf10b131
      6226a991
    • Mark Williams's avatar
      Revert D4805628: [folly] Suppress more warnings for MSVC · 6c4a55d0
      Mark Williams authored
      Summary: This reverts commit 9574ea984e1e3daca01101259687f46effcf3a9f
      
      Differential Revision: D4805628
      
      fbshipit-source-id: 3285317a4c3f2012da1f13e9c91b6c623726c9b7
      6c4a55d0
    • Yedidya Feldblum's avatar
      Initialize the singleton-vault early in init() · a411c5f3
      Yedidya Feldblum authored
      Summary:
      Initialize the singleton-vault early in `init()` to avoid ordering problems with other parts of `init()`.
      
      Initialization is done by calling `SingletonVault::singleton()->registrationComplete()`. Do that before (almost) everything, in particular, before parsing args and initializing logging.
      
      Note that this just marks it okay for singletons to be instantiated, but does not by itself instantiate any singletons. However, this is useful if, in some way, parsing args or initializing logging should happen to use singletons.
      
      Reviewed By: andriigrynenko
      
      Differential Revision: D4889777
      
      fbshipit-source-id: 6817db22d38a498cd20e361fc574a146029432ec
      a411c5f3
    • Andrew Krieger's avatar
      Suppress more warnings for MSVC · a110f8da
      Andrew Krieger authored
      Summary:
      Several other warnings that aren't reasonable to disable globally occur in folly headers.
      - Wrap the unreachable code warnings in MSVC specific disable blocks to prevent problems for users.
      - Cast to signed types to perform integral negation before casting back to unsigned for bit operations.
      - Enable a simpler overload for bool->float conversion than one which attempts float->bool.
      - Delete one unneeded undef.
      
      (Note: this ignores all push blocking failures!)
      
      Reviewed By: yfeldblum
      
      Differential Revision: D4805628
      
      fbshipit-source-id: 9574ea984e1e3daca01101259687f46effcf3a9f
      a110f8da
    • Andrew Krieger's avatar
      Remove pthread dependency from CacheLocality.h · 01de3b43
      Andrew Krieger authored
      Summary:
      For getting a thread id for hashing, std::this_thread::get_id()
      is just as good and also removes an unneeded pthreads dependency. This enables
      using MPMCQueue on Windows without pthreads as well.
      
      Reviewed By: Orvid, yfeldblum
      
      Differential Revision: D4879940
      
      fbshipit-source-id: c4fb5eea165eb450240f94904aa26a10aa394d1b
      01de3b43
    • Christopher Dykes's avatar
      Switch TimedRWMutex implementation to use lock_guard where possible · 4e509c4b
      Christopher Dykes authored
      Summary: As titled. There are some places where scoping prevents trivial conversion, so I've left those places with explicit lock/unlock calls.
      
      Reviewed By: andriigrynenko, yfeldblum
      
      Differential Revision: D4888812
      
      fbshipit-source-id: c124306e0373ee9eb395cb98f88df63c91523d48
      4e509c4b
    • Christopher Dykes's avatar
      Use getCurrentThreadID() rather than pthread_self() in MemoryIdler · 04de301e
      Christopher Dykes authored
      Summary: Ignoring the questionability of the approach it's being used in, it's better to not have the direct PThread dependency.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D4889245
      
      fbshipit-source-id: da099c6f938dbe98c1b9eeaf4de0a27a2c4d65f1
      04de301e
    • Andrew Krieger's avatar
      Explicitly use CreateFileA in readlink · 91b69f13
      Andrew Krieger authored
      Summary:
      In Unicode enabled projects, this errors because CreateFile aliases
      CreateFileW, which takes wchar_t* not char*.
      
      Reviewed By: Orvid, yfeldblum
      
      Differential Revision: D4878424
      
      fbshipit-source-id: b44b369c0533e74163f68d95c2bf353584033731
      91b69f13
    • Christopher Dykes's avatar
      Support folly::getCurrentThreadID() without PThread · ee080728
      Christopher Dykes authored
      Summary: Just use the native Windows API call instead, as it gives the same result.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D4887587
      
      fbshipit-source-id: adbfd288bea425f1aff46d0685083807490f7f09
      ee080728
    • Christopher Dykes's avatar
      Don't use pthread_spinlock_t in TimedRWMutex · 214b26f3
      Christopher Dykes authored
      Summary: `TimedMutex` was already using `folly::SpinLock`, so switch `TimedRWMutex` to do the same.
      
      Reviewed By: andriigrynenko
      
      Differential Revision: D4888005
      
      fbshipit-source-id: 6e782347bc22dc186ed41f2e77c6614b8444bae2
      214b26f3
  10. 13 Apr, 2017 4 commits
    • Christopher Dykes's avatar
      Switch includes of PThread to the portability header · 62134365
      Christopher Dykes authored
      Summary:
      As part of the work towards getting Folly compiling without PThread, it needs to be treated as a non-portable include.
      This switches the includes not already covered by other diffs.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D4882777
      
      fbshipit-source-id: d9521564c814f9bcff2fcb358cbb89b3777c327d
      62134365
    • Christopher Dykes's avatar
      Fix 1/2 of exception_wrapper under MSVC · 8a569003
      Christopher Dykes authored
      Summary:
      MSVC didn't like referring to members of `exception_wrapper` in the initializer for a `static constexpr` field directly in `exception_wrapper`, so shift the initialization to the actual definition of the fields.
      As the fields are only referred to via their address, dropping the `constexpr` loses nothing.
      
      Reviewed By: ericniebler
      
      Differential Revision: D4873939
      
      fbshipit-source-id: 30b690b1ab3f2f7a25b9dc4863b46f64c811797d
      8a569003
    • Neel Goyal's avatar
      Add method to check if SSL Lock is disabled · e7231fdb
      Neel Goyal authored
      Summary:
      Add a method where users can determine if a SSL lock is disabled.
      
      This can help when it comes to making decisions about things like whether reusing SSL Contexts is safe in multithreaded programs.
      
      Reviewed By: siyengar
      
      Differential Revision: D4875780
      
      fbshipit-source-id: 91e9259fee25856be1b77823559d16d0679bde5b
      e7231fdb
    • Christopher Dykes's avatar
      Kill a couple of PThread includes · 37af0398
      Christopher Dykes authored
      Summary: They aren't actually needed, and are in the way of being able to build Folly without PThread.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D4882410
      
      fbshipit-source-id: e4a48600f79c57bb965a35fab94962a29b8e06d4
      37af0398