- 01 Aug, 2016 3 commits
-
-
Christopher Dykes authored
Summary: A `long` is only 32-bits on MSVC, so this is simply wrong. Shift a `T` left instead. Reviewed By: yfeldblum Differential Revision: D3651139 fbshipit-source-id: 3bbfd18ed0c372287c4ec6cbcc543f6f1fcc4139
-
Christopher Dykes authored
Summary: Because the check macros attempt to pipe the values to the error stream, but we can't do that with the Windows implementation. Switch to `std::this_thread::get_id()` instead because it's standard and can be piped. Reviewed By: djwatson Differential Revision: D3650362 fbshipit-source-id: 8af65448a33949f310abc818d95bac843214b685
-
David Wilemski authored
Summary: Noticed this while reading the code. Reviewed By: yfeldblum Differential Revision: D3648565 fbshipit-source-id: c00940e5ce91fbc7e5cc6c42e35c5deee3e0bf65
-
- 30 Jul, 2016 1 commit
-
-
Aaryaman Sagar authored
Summary: Initializer list construction can often have conflictingly similar syntax as uniform initialization. As a result APIs and classes often either avoid using `std::initializer_list`s or deprecate construction with `std::initializer_list`s. This change provides a tag similar to `std::piecewise_construct_t` to help out. Reviewed By: simpkins Differential Revision: D3617276 fbshipit-source-id: 3c74802f946a22e1a4ee52eca0f89df4a028eb22
-
- 29 Jul, 2016 7 commits
-
-
Dave Watson authored
Summary: Test timers where we need to reschedule the wheel timer next tick. This wasn't tested before, since we were always ticking, and never needed to reschedule. Differential Revision: D3637103 fbshipit-source-id: cb80e7b790bb6aac68bdb5f60f8aa00caa2e5b69
-
Giuseppe Ottaviano authored
Summary: GCC's `__cxa_demangle()` uses on-stack data structures for the parser state which are linear in the number of components of the symbol. For extremely long symbols, this can cause a stack overflow. This diff introduces an arbitrary symbol length limit above which we just return the mangled name. Reviewed By: philippv Differential Revision: D3641115 fbshipit-source-id: ec360bb20ca499fd0eaf3a06c5bbcbd1e936d845
-
Anirudh Ramachandran authored
Summary: Similar to other getters such as getSSLCertSize, but returns a const X509*. This may be useful to get cert parameters after handshake is complete (or in error). Reviewed By: yfeldblum Differential Revision: D3636598 fbshipit-source-id: 98f0e2987de53d6343541ef0ed588f9ad18390cd
-
Dave Watson authored
Summary: Test doesn't match comments. Remove extranous commented code. I think there was actually a subtle bug in the test: since 25 doesn't evenly divide in to 6, we could end up farther away than we were expecting. The same is true of 10/3, but it remains within the threshold. Reviewed By: yfeldblum Differential Revision: D3637078 fbshipit-source-id: d9881143c33c9b4f203f839e2e5106183301b530
-
Sven Over authored
Summary: When future callbacks are to be executed by an executor (via `via`) and the executor does not actually execute the callback function (for whatever reason), then waiting for the final future (the one returned by `via`) block forever. In case the callback function that got passed to the executor gets destroyed without being executed, the future should be set to a folly::BrokenPromise exception instead of remaining unset forever. This diff modifies the reference counting in folly::detail::Core to make sure the reference held by the callback function is properly removed not only after the callback gets executed, but also when the callback is destroyed without having been executed. Reviewed By: yfeldblum Differential Revision: D3455931 fbshipit-source-id: debb6f3563384a658d1e0149a4aadbbcb268938c
-
Jim Meyering authored
Summary: Building/testing with ASAN would elicit a heap use-after-free. Differential Revision: D3639117 fbshipit-source-id: 30b5fa7d3fe1d804c4fba5bada8197a3a05a8333
-
Yuri Putivsky authored
Summary: takeOwnershipOfPipes should left zero heap memory allocated in folly:Subprocess class instance. Reviewed By: snarkmaster Differential Revision: D3638503 fbshipit-source-id: aac7b10bd7399c44868f32c01164f4123892598f
-
- 27 Jul, 2016 3 commits
-
-
Adam Simpkins authored
Summary: Add an unlock() method to Synchronized LockedPtr objects. This will make it easier to replace current users of the UNSYNCHRONIZED macro. Of the handful of places currently using UNSYNCHRONIZED, many of them want to simply release the lock before logging a message and returning. However, UNSYNCHRONIZED is a poor choice for this, since it will re-acquire the lock on scope exit. In these situations where the function returns from inside an UNSYNCHRONIZED block the code unnecessarily re-acquires the lock just to immediately release it. The unlock() method will provide a cleaner mechanism for these call sites to simply drop the lock early before returning. Reviewed By: yfeldblum Differential Revision: D3547652 fbshipit-source-id: 4d28fe9f3aad0d7348e918d1a3d6c705bfec242b
-
Christopher Dykes authored
Summary: MSVC gives warnings if you shift a 32-bit value left but then assign it to a 64-bit variable. This just makes it a 64-bit shift instead. If we really wanted, this doesn't need to be a size_t to begin with, but it already is, so just leave it alone. Reviewed By: yfeldblum Differential Revision: D3622935 fbshipit-source-id: 25931e6df644df8a2160aa80fd5de21cd9c06159
-
Wez Furlong authored
Summary: MAP_POPULATE is not defined on this system. Instead we will `madvise` the kernel that we will need it so that it will populate the mapping. Reviewed By: yfeldblum Differential Revision: D3584325 fbshipit-source-id: ece52f3d55c475bcd41367f4e9744d6f41001cd5
-
- 26 Jul, 2016 16 commits
-
-
Christopher Dykes authored
Summary: It was using inline assembly in order to get atomic single-bit operations, so add a variant for MSVC that uses intrinsics. MSVC is also weird in-that it doesn't have a 16-bit variant of these, so use an atomic OR and AND to achieve the required effect. Reviewed By: yfeldblum Differential Revision: D3623220 fbshipit-source-id: b4ff985ef2ed7787115f4d20de6f244123410dc8
-
Christopher Dykes authored
Summary: That way the mismatch warning can stay as an error. Reviewed By: yfeldblum Differential Revision: D3613761 fbshipit-source-id: 6e0ee42c658d95786f578f6500aba113c00d8f77
-
Christopher Dykes authored
Summary: While the previous version did compile, it wouldn't actually work at link time. Reviewed By: meyering Differential Revision: D3614424 fbshipit-source-id: 578677b65edca720330319594e1163d214e1400d
-
Christopher Dykes authored
Summary: When I initially added the surrounding `#ifdef` I failed at where I put my `#endif`, as I left the shared library test enabled. This disables it for Windows. Reviewed By: yfeldblum Differential Revision: D3622769 fbshipit-source-id: f263201239095bbef076300d5f40649ebee1173c
-
Christopher Dykes authored
Summary: It didn't like using `decltype(args)`, which wasn't really necessary as we already have it's type. Reviewed By: yfeldblum Differential Revision: D3623424 fbshipit-source-id: 994c23cbf486d427c6dd0fe4c6f768e51ea15ad1
-
Christopher Dykes authored
Summary: It doesn't exist anywhere else, and `syscall` isn't even defined on Windows, so this completely failed to compile before. Reviewed By: yfeldblum Differential Revision: D3623382 fbshipit-source-id: 302093ddc96d6465e0dcc1883747229a7fb25a84
-
Christopher Dykes authored
Summary: So that the `[[noreturn]]` attribute can be applied. Reviewed By: yfeldblum Differential Revision: D3614122 fbshipit-source-id: 4b95cb553e85c85c277c00b8165671dcc75afac8
-
Christopher Dykes authored
Summary: Specifically the loosening of the definition of a range where-by the end of an iterator may be represented by a different type than the beginning of the range. Oh, and it also fixes compilation on MSVC, which didn't like the decltype being used to determine the iterator type. Reviewed By: yfeldblum Differential Revision: D3613993 fbshipit-source-id: 2940a15d0f93c5b6310d0b1896f5d12ca9aec639
-
Michael Lee authored
Summary: Add a declaration to mock out FlagSaver on platforms that don't support gflags. Reviewed By: ivmaykov, yfeldblum Differential Revision: D3620421 fbshipit-source-id: c1047f34f384f34276b18f53e966a65cdd5c8075
-
Andrii Grynenko authored
Summary: This allows having some logic executed before and after FiberManager loop (e.g. grabbing a Python GIL). Reviewed By: A5he Differential Revision: D3616752 fbshipit-source-id: 3be35d54ced458328816d583133457a44a863acd
-
Yang Chi authored
Summary: This crashes unit test with asan, since we never deletes it. Reviewed By: djwatson Differential Revision: D3622847 fbshipit-source-id: f7ea7c4f464843353b24a59adefd5d66b95bc169
-
Yang Chi authored
Summary: cb is an unused variable, and i got error in android. It seems like we don't need to go through the list to increase count. Differential Revision: D3622772 fbshipit-source-id: fe1f81a1fcad5bacad052e14b7b0b370beb3f3e5
-
Christopher Dykes authored
Summary: MSVC needs a bit more glue to expand the varargs. Reviewed By: yfeldblum Differential Revision: D3614681 fbshipit-source-id: 901d8c5138b1d2d28434c51bdff31f6d21f26681
-
Christopher Dykes authored
Summary: Because it's using `ssize_t`, which MSVC defines weirdly. Reviewed By: yfeldblum Differential Revision: D3614050 fbshipit-source-id: 422621ea0dc92b374fa6dfc32a5391c1093d039e
-
Neel Goyal authored
Summary: Refactor the socket peeker into its own class so that it can be used in other places as well, for example for peeking at plaintext traffic. Reviewed By: knekritz Differential Revision: D3521899 fbshipit-source-id: fcd5615dd5d7cd1ddece4c624efbdecfbbc88a09
-
Misha Shneerson authored
Summary: We should go back to 10ms granularity. Because regressions - https://www.facebook.com/groups/wfi/permalink/1107102889338325/ Reviewed By: haijunz Differential Revision: D3616784 fbshipit-source-id: dc1d7ff5195ae836df4a334a9ac5c41164c0627b
-
- 24 Jul, 2016 3 commits
-
-
Giuseppe Ottaviano authored
Reviewed By: yfeldblum Differential Revision: D3611881 fbshipit-source-id: 3991c18cc2956e9d0b50a20e6daf913ec58ee501
-
Giuseppe Ottaviano authored
Reviewed By: dkgi Differential Revision: D3586189 fbshipit-source-id: ce817233a0293e19400b5689c283531be6302c10
-
Qinfan Wu authored
Summary: As more code is using mallctl, it's worth making these helper functions available everywhere. Reviewed By: yfeldblum Differential Revision: D3576190 fbshipit-source-id: 968e80e00f2ed93542e117c24861c21745b63f20
-
- 23 Jul, 2016 1 commit
-
-
Yedidya Feldblum authored
Summary: [Folly] Move `RequestContext` definitions to source files. Keeping headers lightweight can help with build times. Reviewed By: djwatson Differential Revision: D3609809 fbshipit-source-id: 20608e3ff764c86c24355a328da1dcca9a08fce4
-
- 22 Jul, 2016 6 commits
-
-
Melanie Subbiah authored
Summary: In order to trigger trace points when a new thread begins/finishes executing, I added functionality to call onSet and onUnset methods on all RequestData objects whenever setContext is called. The main question: will this approach cost us too much overhead? Reviewed By: djwatson Differential Revision: D3604948 fbshipit-source-id: 3b704ca0f2b713458427aa49be12f776939057f8
-
Mark Isaacson authored
Summary: This code very obviously wrote past the end of the buffer when the length was 1. Furthermore, it was just downright broken for all values. The author obviously meant to type * instead of +. I took the time to verify that the algorithm is actually correct, while I was working on this. My proof is in the test plan. Reviewed By: yfeldblum, meyering Differential Revision: D3603255 fbshipit-source-id: 5f2a0011ff5401a70ba03993eab6e53e29d87c1c
-
Christopher Dykes authored
Summary: Because Windows already defines a funtion named `GetTickCount` with a different signature. Reviewed By: yfeldblum Differential Revision: D3601877 fbshipit-source-id: fa0fb422156a3dc71e149e02a000ccdf3479eea5
-
Christopher Dykes authored
Summary: There was an MSVC section, but it's much simpler to just use the glue to solve the issue instead. Reviewed By: yfeldblum Differential Revision: D3601184 fbshipit-source-id: f95bd3dfc4b244e1bce21997f44de2970575ad7f
-
Christopher Dykes authored
Summary: A `long` on MSVC is only 4 bytes, so the `static_assert` will fail. Remove the static assert and use the `long long` version instead. Do the same for the unsigned version. Reviewed By: yfeldblum Differential Revision: D3601064 fbshipit-source-id: 70c5f4bca597ba05c3729f5d15feeea3cc8fde57
-
Christopher Dykes authored
Summary: Because we need it for MSVC. Reviewed By: yfeldblum Differential Revision: D3601138 fbshipit-source-id: 4d2ba3f9c972717745289686b025d2763f9ef30d
-