1. 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
  2. 29 Jul, 2015 15 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
    • Sara Golemon's avatar
      Regenerate README.md from source · c3e2a712
      Sara Golemon authored
      Summary: Also fix URLs hand-modified by D2219135 which didn't quite update them enough.
      Point them at the new repo.
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2285053
      c3e2a712
    • Orvid King's avatar
      Move various attributes before the declaration to be compatible with MSVC · 6646f7f2
      Orvid King authored
      Summary: MSVC will just produce syntax errors if these are left where they currently are. GCC and LLVM support them in either location with the same meaning.
      Closes #267
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2283889
      
      Pulled By: @sgolemon
      6646f7f2
  3. 28 Jul, 2015 10 commits
    • Orvid King's avatar
      Use fsync on MSVC, as fdatasync doesn't exist · 607f5f95
      Orvid King authored
      Summary: Closes #266
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2283774
      
      Pulled By: @sgolemon
      607f5f95
    • Orvid King's avatar
      Use intrinsics for RWSpinLock when on MSVC. · 4b019355
      Orvid King authored
      Summary: Closes #261
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2283554
      
      Pulled By: @sgolemon
      4b019355
    • Orvid King's avatar
      Add MSVC support for FOLLY_DEPRECATED · 7ea0415c
      Orvid King authored
      Summary: This adds MSVC support for `FOLLY_DEPRECATED`.
      Closes #257
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2283484
      
      Pulled By: @sgolemon
      7ea0415c
    • Orvid King's avatar
      Normalize SSE support detection · f9651857
      Orvid King authored
      Summary: This unifies ways of detecting SSE support into the FOLLY_SSE define which is a numeric value from 0 to 4.2 depending on detected level.
      This also adds a `#define` for `__extension__` which is used in folly, but is GCC specific.
      Closes #259
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2283522
      
      Pulled By: @sgolemon
      f9651857
    • Orvid King's avatar
      Add MSVC support for FOLLY_FINAL and FOLLY_OVERRIDE · 0c1113b9
      Orvid King authored
      Summary: This adds MSVC support for `FOLLY_FINAL` and `FOLLY_OVERRIDE`.
      Closes #258
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2283502
      
      Pulled By: @sgolemon
      0c1113b9
    • Orvid King's avatar
      Add detection of MSVC RTTI · 90db5bb6
      Orvid King authored
      Summary: This adds MSVC support to the detection of FOLLY_HAS_RTTI.
      Closes #255
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2283036
      
      Pulled By: @sgolemon
      90db5bb6
    • Jason Rahman's avatar
      Allow for mutable lambdas with Future::ensure() · 9ca0389d
      Jason Rahman authored
      Summary: Update the internal lambda to mutable to support mutable lambdas as
      parameters to Future::ensure()
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2286097
      9ca0389d
    • Orvid King's avatar
      Add typename qualifiers to Singleton.h · c23b7977
      Orvid King authored
      Summary: MSVC complains if these are not there.
      Closes #248
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2282845
      
      Pulled By: @sgolemon
      c23b7977
    • Orvid King's avatar
      Support GroupVarint.h under MSVC · a51326dc
      Orvid King authored
      Summary: MSVC supports the intrinsics used by it without any issue other changes, so just make sure the error doesn't trigger on MSVC.
      Closes #252
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2282942
      
      Pulled By: @sgolemon
      a51326dc
    • Orvid King's avatar
      Add support for MSVC in asm_pause in Portability.h · 778b5711
      Orvid King authored
      Summary: This implements support for `asm_volatile_pause` and `asm_pause`, as defined in `Portability.h`, for MSVC.
      This is needed because MSVC x64 doesn't support inline assembly.
      Closes #254
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2283006
      
      Pulled By: @sgolemon
      778b5711
  4. 27 Jul, 2015 7 commits
    • Orvid King's avatar
      Adjust a literal in AtomicHashMap.h to be correctly sized · 150fc4e9
      Orvid King authored
      Summary: Noticed because of a warning emitted by MSVC, this fixees the literal for `kLockedPtr_` to correctly be 64-bits under MSVC, rather than 32-bit.
      Closes #245
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2282806
      
      Pulled By: @sgolemon
      150fc4e9
    • Orvid King's avatar
      Fix the size of the enum in FBString.h under MSVC · 51eee59b
      Orvid King authored
      Summary: MSVC defaults enum sizes to int, so explicitly use `size_t` as the base to have it correctly sized.
      Closes #246
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2282816
      
      Pulled By: @sgolemon
      51eee59b
    • Sophia Wang's avatar
      fix clang ASAN error in DelayedDestructionBaseTest · 8fe31d96
      Sophia Wang authored
      Summary: fix a use after free bug. this line is stupid!
      
      Reviewed By: @siyengar
      
      Differential Revision: D2283041
      8fe31d96
    • James Sedgwick's avatar
      delete folly/wangle · 8e922526
      James Sedgwick authored
      Summary: she's gooooooone, oh why, oh why, i better learn how to face it...
      
      https://www.youtube.com/watch?v=bnVXIUyshng
      
      Reviewed By: @djwatson
      
      Differential Revision: D2219135
      8e922526
    • Sara Golemon's avatar
      Bump version to 52:0 · eafa57ba
      Sara Golemon authored
      eafa57ba
    • Alexey Spiridonov's avatar
      Make ProcessReturnCode default-constructible · 3f277b37
      Alexey Spiridonov authored
      Summary: We have this previously-unused "NOT STARTED" status, which I recently appropriated to denote moved-out `ProcessReturnCode`s.
      
      It's natural to also use this for default-constructed `ProcessReturnCodes`. Lacking a default constructor leads to a bunch of unnecessarily annoying use of `folly::Optional` in my upcoming diff, so I wanted to get rid of that, see e.g.
      
      differential/diff/7657906/
      
      Reviewed By: @tudor
      
      Differential Revision: D2097368
      3f277b37
    • Alexey Spiridonov's avatar
      Improve waitpid error handling · b10e3e86
      Alexey Spiridonov authored
      Summary: Using `checkUnixError` after `waitpid()` is confusing and useless, because the only two possible errors are `ECHILD` (some other part of the program waited for this process!?) and `EINVAL` (invalid options, which are hardcoded in both `Subprocess::wait()` and `poll()`). Neither of these are recoverable. Moreover, even if the caller catches the exception, `~Subprocess` is still booby-trapped to `abort()` since its status remains `RUNNING`.
      
      In short, just abort.
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2079415
      b10e3e86
  5. 25 Jul, 2015 1 commit
    • mwilliams's avatar
      Fix some warnings in folly · 7b481d96
      mwilliams authored
      Summary: Remove a couple of unused variables, and move one
      that was only used inside an ifdef
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2279989
      7b481d96
  6. 24 Jul, 2015 4 commits
    • Nathan Bronson's avatar
      added a missing hook to IndexedMemPool's testing harness · 30e9f34e
      Nathan Bronson authored
      Summary: IndexedMemPool had one bare usage of std::atomic, rather than
      the templated type Atom.  This doesn't affect any non-testing template
      instantiations, because those two are usually synonyms, but it could cause
      spurious failures of DeterministicSchedule tests.  Found via inspection,
      not via failed tests.
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2277424
      30e9f34e
    • Misha Shneerson's avatar
      Print type of singleton that is requested after destruction · 29d3553c
      Misha Shneerson authored
      Summary: As titled
      Trying to troubleshoot shutdown problems in HHVM and I see:
        EventBase::runAfterDelay() callback threw St13runtime_error exception: Raw pointer to a singleton requested after its destruction.
      Would be much easier to troubleshoot if I know what is it being requested.
      
      Reviewed By: @chipturner
      
      Differential Revision: D2274497
      29d3553c
    • Nathan Bronson's avatar
      improvements to DeterministicSchedule · a4fc31fc
      Nathan Bronson authored
      Summary: This diff isolates the CacheLocality back end for DeterministicSchedule
      from one invocation to the next (the last one was deterministic
      across the entire program but not per-DeterministicSchedule instance),
      and makes it easy to do extensive tracing of memory accesses during
      a deterministic test.  These changes were made while tracking down a
      bug, but don't fix any bugs on their own (and in fact don't affect any
      production code at all).
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D1842390
      a4fc31fc
    • Andre Pinto's avatar
      Fix oss build · 2f0b7834
      Andre Pinto authored
      Summary: Add program_options to fix oss build
      
      Reviewed By: @tudor
      
      Differential Revision: D2274863
      2f0b7834