1. 17 Aug, 2015 3 commits
    • Orvid King's avatar
      Remove `unsigned char v = static_cast<unsigned char>(v);` · cd69a53a
      Orvid King authored
      Summary: MSVC spotted this very suspicious line when I was running it with /analyze, and complained about using an unitialized variable. This variable isn't used anywhere in the function, and is initializing itself with itself. I have no idea how this compiled in the first place, but apparently it does.
      This removes the line in question.
      Closes #295
      
      Reviewed By: @yfeldblum, @paulbiss
      
      Differential Revision: D2340688
      
      Pulled By: @sgolemon
      cd69a53a
    • Orvid King's avatar
      Implement Random.cpp for MSVC · 9af38044
      Orvid King authored
      Summary: This uses `<random>` to implement it, because there is no `/dev/urandom` on Windows.
      Closes #250
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2282887
      
      Pulled By: @sgolemon
      9af38044
    • Yedidya Feldblum's avatar
      Extract folly/io/async/test/RequestContextTest.cpp (from Thrift). · 750586e0
      Yedidya Feldblum authored
      Summary: [Folly] Extract folly/io/async/test/RequestContextTest.cpp (from Thrift).
      
      Reviewed By: @haijunz
      
      Differential Revision: D2350908
      750586e0
  2. 15 Aug, 2015 1 commit
  3. 14 Aug, 2015 3 commits
  4. 13 Aug, 2015 2 commits
  5. 12 Aug, 2015 6 commits
    • Orvid King's avatar
      Don't warn if pthread_atfork isn't avaliable on MSVC · 919d8e39
      Orvid King authored
      Summary: Because we don't even have `fork` to begin with under MSVC.
      Closes #278
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2306518
      
      Pulled By: @sgolemon
      919d8e39
    • Orvid King's avatar
      Add MSVC support to MaxAlign · 614ca624
      Orvid King authored
      Summary: This adds MSVC support to the detection of `MaxAlign` in `Portability.h`.
      Closes #256
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2283221
      
      Pulled By: @sgolemon
      614ca624
    • Orvid King's avatar
      Handle some scoping issues in Conv.h under MSVC · 21f7a3c1
      Orvid King authored
      Summary: No idea why these are the only two places it complains about, but it does.
      This just explicitly scopes them.
      Closes #253
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2282985
      
      Pulled By: @sgolemon
      21f7a3c1
    • Yedidya Feldblum's avatar
      CodeMod apache::thrift::transport::TSocketAddress to folly::SocketAddress. · aa6e8869
      Yedidya Feldblum authored
      Summary: [Folly] CodeMod apache::thrift::transport::TSocketAddress to folly::SocketAddress.
      
          yes | codemod --extensions h,tcc,cpp '^#include [<"]thrift/lib/cpp/transport/TSocketAddress\.h[>"]$' '#include <folly/SocketAddress.h>'
          yes | codemod --extensions h,tcc '\b(((apache::)?thrift::)?transport::)?TSocketAddress\b' 'folly::SocketAddress'
          yes | codemod --extensions cpp '^using apache::thrift::transport::TSocketAddress;$' 'using folly::SocketAddress;'
          yes | codemod --file-list "$(git ls-files "**/*.cpp" | xargs grep -P '^using (namespace folly|folly::SocketAddress);$' | cut -d: -f1 | paste -s -d,)" '\b(((apache::)?thrift::)?transport::)?TSocketAddress\b' 'SocketAddress'
          yes | codemod --extensions cpp '\b(((apache::)?thrift::)?transport::)?TSocketAddress\b' 'folly::SocketAddress'
          yes | codemod --extensions h,tcc,cpp -m '^\s*typedef folly::SocketAddress folly::SocketAddress;\n' ''
          yes | codemod --file-list thrift/lib/cpp/Makefile.am -m '^\s*transport/TSocketAddress\.h \\\n' ''
          rm thrift/lib/cpp/transport/TSocketAddress.h
      
      Reviewed By: @Invalid auth token., @​luk
      
      Differential Revision: D2325523
      aa6e8869
    • Orvid King's avatar
      Disable VDSO on MSVC · abb1acc6
      Orvid King authored
      Summary: MSVC will never be able to load VDSO, and doesn't even have dlopen, so just return `nullptr`, and let the fallback mechanisms handle it from there.
      Closes #282
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2307461
      
      Pulled By: @sgolemon
      abb1acc6
    • Hannes Roth's avatar
      (Wangle) Use perfect forwarding for LambdaBufHelper · 1e06e1db
      Hannes Roth authored
      Summary: Perfect forwarding only works if the function is templated on the same type, not if the type is a class template.
      
      Discovered by @lbrandy.
      
      Reviewed By: @yfeldblum, @lbrandy
      
      Differential Revision: D2333005
      1e06e1db
  6. 11 Aug, 2015 3 commits
  7. 10 Aug, 2015 1 commit
  8. 09 Aug, 2015 1 commit
    • Brett Simmers's avatar
      Support dynamic field width in folly::format() · aa7aebf3
      Brett Simmers authored
      Summary: I added this to support logging with varying indentation levels, but
      it could also be useful in other situations. Examples are in the
      test/documentation.
      
      Reviewed By: @tudor
      
      Differential Revision: D2322206
      aa7aebf3
  9. 07 Aug, 2015 1 commit
    • Yedidya Feldblum's avatar
      Avoid incorrect constexpr in folly/AtomicHashArray.h. · a64e4f2d
      Yedidya Feldblum authored
      Summary: [Folly] Avoid incorrect constexpr in folly/AtomicHashArray.h.
      
      It's actually not transitively constexpr, because it uses const values that are not themselves constexpr. Depending on the compiler, it could theoretically fail to build.
      
      Reviewed By: @Gownta
      
      Differential Revision: D2322143
      a64e4f2d
  10. 06 Aug, 2015 2 commits
    • Anton Likhtarov's avatar
      Easy: disable guard pages by default · e7e569e9
      Anton Likhtarov authored
      Summary: Mcrouter still enables these by default.  Tracking down a perf regression in another code path that uses fibers.
      
      Reviewed By: @JohnRambo
      
      Differential Revision: D2320772
      e7e569e9
    • Alexander Shaposhnikov's avatar
      Make Core.size test portable · d7eea493
      Alexander Shaposhnikov authored
      Summary: Add a golden struct for checking the size of Core.
      It makes this test pass on OSX
      (now failing because of the different size of std::function).
      
      Reviewed By: @​hannesr
      
      Differential Revision: D2315429
      d7eea493
  11. 05 Aug, 2015 4 commits
  12. 04 Aug, 2015 3 commits
    • Nathan Bronson's avatar
      make RetryingTest more robust · b70fcab6
      Nathan Bronson authored
      Summary: Make RetryingTest more robust by giving it multiple chances to
      meeting timing criteria.
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2306245
      b70fcab6
    • Yedidya Feldblum's avatar
      Refactor extract FOLLY_SYNCHRONIZED_HAVE_TIMED_MUTEX. · 77f6a914
      Yedidya Feldblum authored
      Summary: [Folly] Refactor extract FOLLY_SYNCHRONIZED_HAVE_TIMED_MUTEX.
      
      The same complex check is done in two places. Ick. Extract it to a single place.
      
      Reviewed By: @​mzlee
      
      Differential Revision: D2302885
      77f6a914
    • Alexander Shaposhnikov's avatar
      Fix a bad bug in folly::ThreadLocal (incorrect using of pthread) · 0347a79f
      Alexander Shaposhnikov authored
      Summary: Fix incorrect using of pthread in folly::ThreadLocal.
      
      The root of the trouble (see man pthread_key_create):
      "At thread exit, if a key value has a non-NULL destructor pointer,
      and the thread has a non-NULL value associated with that key,
      the value of the key is set to NULL, and then the function pointed to is called
      with the previously associated value as its sole argument."
      
      At thread exit we need to recover the thread-specific threadEntry
      otherwise the subsequent calls of getThreadEntry may recreate it
      (what actually DOES  happen in the test ThreadLocalPtr.CreateOnThreadExit)
      and the newly created threadEntry will "leak". It will live longer than the corresponding
      thread violating the internal invariant of StaticMeta and also it will break
      the code of the method onThreadExit. In particular this bug causes the failure
      of the test ThreadLocalPtr.CreateOnThreadExit on OSX.
      
      Reviewed By: @lbrandy
      
      Differential Revision: D2304950
      0347a79f
  13. 03 Aug, 2015 1 commit
    • Orvid King's avatar
      Add MSVC support to futures/Deprecated.h · cbaaa2db
      Orvid King authored
      Summary: It was originally unconditionally useing `__attribute__` syntax, so this makes it conditionally use the `__declspec` syntax.
      Closes #268
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2283909
      
      Pulled By: @sgolemon
      cbaaa2db
  14. 02 Aug, 2015 1 commit
  15. 01 Aug, 2015 1 commit
  16. 31 Jul, 2015 7 commits
    • Michael Lee's avatar
      Not to use EventBaseLocal on mobile · 042b0f22
      Michael Lee authored
      Summary: Temp remove EventBaseLocal on mobile.
      
      Reviewed By: @djwatson
      
      Differential Revision: D2302322
      042b0f22
    • Michael Lee's avatar
      No std::recursive_timed_mutex and std::timed_mutex. · bfe9e3dd
      Michael Lee authored
      Summary: Do not use these if __ANDROID__ is defined as well.
      
      Reviewed By: @​yangchi
      
      Differential Revision: D2301782
      bfe9e3dd
    • Orvid King's avatar
      Fix a parse error in detail/ThreadLocalDetail.h under MSVC · 0aac0635
      Orvid King authored
      Summary: I have no idea why this specific declaration would error, or if there is a difference in meaning, but this fixes MSVC's absurd parser error.
      Closes #277
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2284096
      0aac0635
    • Orvid King's avatar
      Generalize FOLLY_SPIN_WAIT to use Portability methods · d383a116
      Orvid King authored
      Summary: Improves MSVC support.
      Closes #274
      
      Note that this diff has been heavily modified from @Orvid's original PR by @yfeldblum and @sgolemon
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2284035
      
      Pulled By: @sgolemon
      d383a116
    • Orvid King's avatar
      Use constexpr initializers for AtomicHashArray Config · f02969df
      Orvid King authored
      Summary: Closes #264
      
      Modified by @sgolemon from the original PR to declare MSVC2015-final as the official minimum version, making the defines in the original PR unnecessary.
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2284130
      
      Pulled By: @sgolemon
      f02969df
    • Nick Terrell's avatar
      Overload on dynamic object reference type. · 117385fb
      Nick Terrell authored
      Summary: There are a bunch of methods in `folly::dynamic` that return a
      reference to a sub-object, e.g. `getString()`.
      These methods are a bit unsafe because it allows you to write code with dangling
      references when the `folly::dynamic` object is an rvalue:
      
        auto& obj = parse_json(some_string).at("key");
      
      However, the bigger win is that when we have an rvalue `folly::dynamic`, such as
      returned by `getDefault(...)`, we can move the sub-object out:
      
        auto obj = parse_json(some_string).at("key");
        auto str = obj.getDefault("another-key", "").getString();
      
      In the first line, the subobject is copied out when it could be safely moved out.
      In the second line `getDefault(...)` copies the dynamic sub-object out, and then
      `getString()` copies the string out, when the string could be moved.
      
      Also in the case of `getDefault()` being called on a rvalue, we can move the
      sub-object out.
      
      Reviewed By: @marcinpe
      
      Differential Revision: D2267588
      117385fb
    • Sophia Wang's avatar
      DelayedDestruction cleanup · d615b776
      Sophia Wang authored
      Summary: remove unnecessary stuff
      
      Reviewed By: @siyengar
      
      Differential Revision: D2284095
      d615b776