1. 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
  2. 05 Aug, 2015 4 commits
  3. 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
  4. 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
  5. 02 Aug, 2015 1 commit
  6. 01 Aug, 2015 1 commit
  7. 31 Jul, 2015 12 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
    • Brian Watling's avatar
      Add accessor to estimate a FiberManager's run queue size · 207ab876
      Brian Watling authored
      Summary: Add accessor to estimate a FiberManager's run queue size
      
      Reviewed By: @sarangbh
      
      Differential Revision: D2293367
      207ab876
    • Andrew Gallagher's avatar
      folly: fix another test running under buck · d7c649a4
      Andrew Gallagher authored
      Reviewed By: @yfeldblum
      
      Differential Revision: D2300047
      d7c649a4
    • Andrew Gallagher's avatar
      folly: fix tests running under buck (w/ clang and dynamic linking) · 932cba0f
      Andrew Gallagher authored
      Summary: Various fixes to get tests passing using buck's dev mode.
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2299981
      932cba0f
    • Yedidya Feldblum's avatar
      futures::retrying. · e0de0a27
      Yedidya Feldblum authored
      Summary: [Folly] futures::retrying.
      
      Reviewed By: @fugalh
      
      Differential Revision: D2201630
      e0de0a27
    • Ondrej Lehecka's avatar
      Fix 'missing declarations' and 'unusued parameter' warnings · 17e68d98
      Ondrej Lehecka authored
      Summary: enum iterators operator!= didn't use the iterator parameter for comparison
      because they assumed you only ever compare to end. Change the operator!= to
      look at the iterator parameter to check if it was end.
      
      Thrift generated code for reflection initializers for some types that weren't
      declared before definition because they were never called outside of the file.
      Marked those initializers as 'static'.
      
      Reviewed By: @alandau
      
      Differential Revision: D2284371
      17e68d98
  8. 30 Jul, 2015 3 commits
    • Mark McDuff's avatar
      add EventBase-local storage abstraction · b74275bb
      Mark McDuff authored
      Summary: This has come up a couple times, and the implementation is never nice.  Just like we have thread-local storage, it will be useful to also have evb-local storage.  Provides at pretty simple get/set/delete interface (see unittest).
      
      Reviewed By: @djwatson
      
      Differential Revision: D2203063
      b74275bb
    • Nima Aghdaii's avatar
      Fix Infinity · 5b8183c1
      Nima Aghdaii authored
      Summary: folly only accepts "Infinity" while deserializing but writes "infinity" when serializing.
      This means folly cannot deserialize what it serialized before.
      If we agree on this, we could update ##fbcode/common## as well: https://fburl.com/136793901
      
      Reviewed By: @marcinpe
      
      Differential Revision: D2293627
      5b8183c1
    • Orvid King's avatar
      Removed an unneeded typename in dynamic.h · b8aa5fcd
      Orvid King authored
      Summary: This `typename` qualifier was unneeded, and MSVC errors if it's there, so remove it.
      Closes #275
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2284056
      
      Pulled By: @sgolemon
      b8aa5fcd
  9. 29 Jul, 2015 13 commits
    • Orvid King's avatar
      Add MSVC support to Singleton's fatalHelper · 520e1276
      Orvid King authored
      Summary: MSVC doesn't support constructor priorities, so use the same code as OSX.
      Closes #272
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2283998
      
      Pulled By: @sgolemon
      520e1276
    • Orvid King's avatar
      Use strerror_s on MSVC · 78230d5f
      Orvid King authored
      Summary: Support for this under mingw was already present, this just uses that for MSVC as well.
      Closes #273
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2284007
      
      Pulled By: @sgolemon
      78230d5f
    • Orvid King's avatar
      Handle MSVC in FBString.h · 1009fdcd
      Orvid King authored
      Summary: Specifically, MSVC doesn't define `std::__ostream_insert`, so just write to the stream instead.
      Closes #270
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2283960
      
      Pulled By: @sgolemon
      1009fdcd
    • Orvid King's avatar
      Switch a couple of uses of __thread to FOLLY_TLS · 3f274113
      Orvid King authored
      Summary: Because MSVC doesn't support `__thread`, and `FOLLY_TLS` is already setup to use the MSVC syntax when needed.
      Closes #269
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2283919
      
      Pulled By: @sgolemon
      3f274113
    • Orvid King's avatar
      Added asm_volatile_memory · d6a6bb23
      Orvid King authored
      Summary: This adds `asm_volatile_memory`, which goes along with the same style used by `asm_volatile_pause`.
      This also switches the two places in `RWSpinLock.h` that were using inline assembly for this to use the new functions instead.
      Closes #260
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2283541
      
      Pulled By: @sgolemon
      d6a6bb23
    • Orvid King's avatar
      Added FOLLY_ALIGNED(), to allow aligning on MSVC as well · 65220fef
      Orvid King authored
      Summary: This adds `FOLLY_ALIGNED` to `Portability.h`, and adjusts the places that were previously using the raw aligned attribute to use this instead.
      
      Closes #262
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2283639
      
      Pulled By: @sgolemon
      65220fef
    • Orvid King's avatar
      Fix Random-inl.h under MSVC · 5e6f4e77
      Orvid King authored
      Summary: With MSVC, `seedData.begin()` does not return a `void*`, so get a pointer to the data, and explicitly cast that to a `void*` instead.
      Closes #251
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2282929
      
      Pulled By: @sgolemon
      5e6f4e77
    • Orvid King's avatar
      Implemented VersionCheck.h for MSVC · e405081d
      Orvid King authored
      Summary: This implements it via a function called on startup. The mechanism used is roughly equivelent of `__attribute__((__constructor__))` in that it doesn't have the ability to set the order of invokation.
      Closes #249
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2282860
      
      Pulled By: @sgolemon
      e405081d
    • Andrey Goder's avatar
      Add space to error message · b4ff87ee
      Andrey Goder authored
      Summary: Before this change you would get an error like:
      "Expected to get greater than or equal to1 for value 0"
      
      Now it add in the space correctly:
      "Expected to get greater than or equal to 1 for value 0"
      
      Reviewed By: @snarkmaster
      
      Differential Revision: D2288454
      b4ff87ee
    • Tudor Bosman's avatar
      Allow ProgramExit(0), add some comments · fecf4b7c
      Tudor Bosman authored
      Summary: exit() is evil, let's make it easier for programs that want to exit
      successfully.
      
      Reviewed By: @meyering
      
      Differential Revision: D2290201
      fecf4b7c
    • Alexander Shaposhnikov's avatar
      Add hasher specializations for enums, pairs and tuples · 879db739
      Alexander Shaposhnikov authored
      Summary: This diff adds partial specializations of folly::hasher for enum types, std::pair and std::tuple.
      We also restrict the specialization for folly::Range to POD value types.
      
      Reviewed By: @ot, @ddrcoder
      
      Differential Revision: D2285554
      879db739
    • Yedidya Feldblum's avatar
      Fix Build: FOLLY_SSE and preprocessor floats. · 408bb708
      Yedidya Feldblum authored
      Summary: [Folly] Fix Build: FOLLY_SSE and preprocessor floats.
      
      Float values for preprocessor symbols are not a thing.
      
      Reviewed By: @​fyan
      
      Differential Revision: D2289436
      408bb708
    • Alexander Shaposhnikov's avatar
      [folly] Enable support of applyTuple for const tuples · 46bb1ed7
      Alexander Shaposhnikov authored
      Summary: This diff fixes the helper template ReturnValue to enable using of applyTuple with
      constant refs.
      
      Reviewed By: @ot, @ddrcoder
      
      Differential Revision: D2284733
      46bb1ed7