- 26 Aug, 2016 5 commits
-
-
Christopher Dykes authored
Summary: Because MSVC doesn't have `random()` and `M_PI` is guarded by a pre-processor macro. Reviewed By: yfeldblum Differential Revision: D3767159 fbshipit-source-id: fcb1c41cd75925455c76efad38423cd52bd98aeb
-
Yunqiao Zhang authored
Summary: The resultant future of collectOne will be fulfilled when the first one of the future in the list completes without exception. If all input futures throws exception, the resultant future will get the last exception that was thrown. Reviewed By: andriigrynenko Differential Revision: D3764760 fbshipit-source-id: 76484254e35182eddc8266865853d65c28170f82
-
David Goldblatt authored
Summary: This class allows easy insertion of padding bytes after an object to ensure that two cacheline-padded elements of an array don't engage in false sharing. Reviewed By: yfeldblum Differential Revision: D3485144 fbshipit-source-id: a3ece1e34566b20f94ff9f66532b2386ab19a9b1
-
Nicholas Ormrod authored
Summary: Malloc.h is intentionally included multiple times, once from folly and once from libstdc++. The current ###pragma once## implicitly allows this to happen. FBString.h has an undef for Malloc.h's include guard, which originally accomplished this goal. The undefing code is presently moot, since its functionality has been replaced by ###pragma once##. Remove it. I noticed this when ott was copying FBString over to libstdc++ in D3757853. The diff that switched the include guards to pragmas was a codemod, and was not specific to fbstring. D3054492 Reviewed By: ot Differential Revision: D3758119 fbshipit-source-id: e796d039a031d5f842ed39bf55a6b1aeb2686bc4
-
Christopher Dykes authored
Summary: Because MSVC is not happy about the member hook when used in complex inheritence scenarios. Reviewed By: yfeldblum Differential Revision: D3774513 fbshipit-source-id: 9e1ef8dd76d966de339f8486ff1a1d0ab1571849
-
- 25 Aug, 2016 6 commits
-
-
Christopher Dykes authored
Summary: Because MSVC is right, this shouldn't be happening, but we test weird things. Reviewed By: yfeldblum Differential Revision: D3773486 fbshipit-source-id: 50f28bf0ac8ff53f63231b4f6f9ce050b509b464
-
Christopher Dykes authored
Summary: With how this was written it would fail if the call to `lseek` failed, or if it succeeded, unless it was setting the length to 0, in which case it would succeed. This makes it work right. Reviewed By: yfeldblum Differential Revision: D3773311 fbshipit-source-id: 3dc94502d0c4259f6f2766b4c0903c081d7c36ab
-
Christopher Dykes authored
Summary: Because apparently this is valid (and we test it). This also adds a check in mmap to make sure we aren't passing an invalid handle to `MapViewOfFileEx`. Reviewed By: yfeldblum Differential Revision: D3772853 fbshipit-source-id: 11593997a3fb12b7b391c5e52661060b71341aef
-
Andrii Grynenko authored
Reviewed By: yfeldblum Differential Revision: D3765642 fbshipit-source-id: 9b1cc4007c553da5082799fa4ed0af8f7850ec8d
-
Christopher Dykes authored
Summary: We are formatting an integer value, so it is doing absolutely nothing at all, as confirmed by the version I implemented for MSVC, which does output the value with digit separators, which fails the unit tests because the unit test expects the digit separators to not be present. What's more, whe specifically assert that the user has not requested digit separators in the format string. This also kills the MSVC special case entirely because it's not needed. Reviewed By: yfeldblum Differential Revision: D3768405 fbshipit-source-id: 388cd0ca9699e257c71798b9bf355aa651748e60
-
Felix Handte authored
Summary: First, folly::static_function_deleter::operator() is in fact a const operation, so this should be a reasonable change. The motivation for this is to make folly::ThreadLocalPtr and folly::static_function_deleter play nice with each other. Minimal example: ```lang=c++ void deleter(int* ptr) { free(ptr); } int main(int argc, char* argv[]) { folly::ThreadLocalPtr<int> tl; tl.reset(std::unique_ptr<int, folly::static_function_deleter<int, deleter>>( new int(0))); return 0; } ``` Currently produces: ``` folly/ThreadLocal.h:207:7: error: no matching function for call to object of type 'const folly::static_function_deleter<int, &deleter>' delegate(ptr); ^~~~~~~~ Test.cpp:10:6: note: in instantiation of function template specialization 'folly::ThreadLocalPtr<int, void>::reset<int, folly::static_function_deleter<int, &deleter>, void>' requested here tl.reset(std::unique_ptr<int, folly::static_function_deleter<int, deleter>>(new int(0))); ^ folly/Memory.h:91:8: note: candidate function not viable: 'this' argument has type 'const folly::static_function_deleter<int, &deleter>', but method is not marked const void operator()(T* t) { f(t); } ^ 1 error generated. ``` With the fix, the build succeeds. Reviewed By: yfeldblum Differential Revision: D3764624 fbshipit-source-id: c28c791b79f1415704c205c36bfda2d888d6c010
-
- 24 Aug, 2016 9 commits
-
-
Stephane Sezer authored
Summary: Closes https://github.com/facebook/folly/pull/458 Reviewed By: yfeldblum Differential Revision: D3765911 Pulled By: Orvid fbshipit-source-id: 30de0b99ec622471e52a775835b5a0564437febc
-
Christopher Dykes authored
Summary: Because it isn't. Not on MSVC anyways. Reviewed By: yfeldblum Differential Revision: D3767326 fbshipit-source-id: 0f9421773819999f99be38ae0646ae3e81bde4e4
-
Yedidya Feldblum authored
Summary: [Thrift] Use `cbegin` and `cend` in static reflection container traits. These are functions that all the C++ standard library containers have. And add the two methods to `folly::sorted_vector_set` and `folly::sorted_vector_map`. Reviewed By: juchem Differential Revision: D3763187 fbshipit-source-id: 9d467a1cf391206eba671f454da428323c4a566a
-
Christopher Dykes authored
Summary: Because event file descriptors don't exist on Windows. This also disables the fork() test on Windows, as we don't have fork(). Reviewed By: yfeldblum Differential Revision: D3766266 fbshipit-source-id: af8d81615957a3d7bdfcb204afbf648723921f76
-
Michael Callahan authored
Summary: GCC 5.3 is confused that we might be trying to assign a 64 bit value to a 32 bit size_t although we are clearly not. Just typecast the confusion away. Reviewed By: yfeldblum Differential Revision: D3762839 fbshipit-source-id: 1b705c4e70b782fdb106844fee52ab25aa038acd
-
Andrii Grynenko authored
Summary: 1. This implements a GraphCycleDetector which can check if newly added edge belongs to a cycle in a directed graph. GraphCycleDetector is used to detect cycles between Observers when creator function is run. 2. This also fixes a bug where new dependencies could be saved even if Observer creator failed. Reviewed By: yfeldblum Differential Revision: D3746743 fbshipit-source-id: 99d10446c56fa4d8f7485f38309e8a282cd21bdf
-
Huapeng Zhou authored
Summary: Titled. ``` mcrouter/lib/carbon/CarbonProtocolReader.h:143:49: required from here folly/small_vector.h:441:38: error: enumeral and non-enumeral type in conditional expression [-Werror] cc1plus: all warnings being treated as errors ``` Reviewed By: yfeldblum Differential Revision: D3763073 fbshipit-source-id: da490e91cdb12dacf37d71c1796239bdc361a31b
-
Jon Maltiel Swenson authored
Summary: The GCC warning "warning: enumeral and non-enumeral type in conditional expression" is logged a lot in many builds since lots of code depends on small_vector. This diff should prevent those warnings. Reviewed By: yfeldblum Differential Revision: D3762835 fbshipit-source-id: 49831e4364e716592287c05d1dbf1912326324f6
-
Phil Willoughby authored
Summary: I tested it doesn't break the gcc 4.9 and clang builds - I didn't try any other versions of anything. build[all] Reviewed By: meyering Differential Revision: D3757152 fbshipit-source-id: a126cd31cb89057dececfed1b265f452ee29fbff
-
- 23 Aug, 2016 4 commits
-
-
Heng Hong Lee authored
Summary: While adding logging around our socket and looking into `AsyncSSLSocket` it seems like the data that is actually written into the socket is not correctly attributed. I added logs and printed out what happens on the socket layer, P56563098 in this paste you can see that the `[fishhook]` logs are actually those added in D3698728. Those are the actual bytes written onto the socket, in the paste, the bytes that are written by the AsyncSocket::bioWrite method are the ones that actually get written onto the socket. some of the bytes written into the bio comes from bf_buff.c and bss_mem.c which are not eventually attributed to a socket message and will be incorrectly counted when getRawBytesWritten/Read invoked on AsyncSSLSocket.cpp Unfortunately/Fortunately this issue is not symmetrical and does not manifest in the getRawBytesReceived in AsyncSSLSocket, reading the bio for read bytes correctly attributes the actual number of bytes written on the socket. moreover, pulling the asyncsocket data for getRawBytesRead doesnt give the full read bytes on wire because SSL_connect and SSL_read dont return the number of bytes they read but return the number of bytes without the TLS bytes used. siyengar seems like a right person to look at this. so adding him here. Would love to discuss more about this and am open to iterating more on this solution Reviewed By: knekritz Differential Revision: D3698744 fbshipit-source-id: 541aa478778b9607f51db194fcbfe28bd23c737f
-
Meng Zhang authored
Summary: include linux/membarrier.h if it is available. Closes https://github.com/facebook/folly/pull/455 Reviewed By: lukenels Differential Revision: D3714952 Pulled By: Orvid fbshipit-source-id: 8c85756af2cb132152b2182816becfea138f0149
-
Giuseppe Ottaviano authored
Summary: `fbstring::assign()` uses `append()`, which triggers exponential growth, but it's preferable that `assign()` behaves like the `fbstring(const char*, size_t)` constructor, which is tight. Also rewrite `operator=()` in terms of `assign()`, to avoid duplicating the logic, and refactor the logic of `append()` for the aliasing case so that it uses the same expansion operation as the non-aliasing case. Reviewed By: luciang Differential Revision: D3754932 fbshipit-source-id: 5423f2a360b4268b6a05dd0ae9d2fe5bd1eb855d
-
Giuseppe Ottaviano authored
Summary: D3743475 adds to `Malloc.h` a dependency on another folly header, which breaks it when used in stand-alone mode. This diff moves the include to the right `#ifdef` section. Reviewed By: Gownta Differential Revision: D3757819 fbshipit-source-id: 71664ca6a3a47b6e4449a4ef603fedf052c5df3b
-
- 22 Aug, 2016 4 commits
-
-
Christopher Dykes authored
Summary: I missed this reference when I moved it to the portability folder. It is already being compiled at its new location. Reviewed By: yfeldblum Differential Revision: D3754227 fbshipit-source-id: 357b0c26ddbcefdc7640f6a334150abba90ed711
-
Christopher Dykes authored
Summary: MSVC can't handle the array as a constexpr value, but works fine with the char*. Reviewed By: yfeldblum Differential Revision: D3705189 fbshipit-source-id: e8208b3f2831a720095641f0e1e72ac63ed845a0
-
Christopher Dykes authored
Summary: `std::__throw_bad_alloc()` is defined in `<new>` on OSX, so bring back the `#ifdef` guards that were there previously. Reviewed By: markw65 Differential Revision: D3749714 fbshipit-source-id: 0338a4cece928fce0b9d33d41c17cfa99a319abe
-
pp__qq authored
Summary: fix(FBString): compile error on instantiate `basic_fbstring` with a `Storage` that is not `fbstring_core<E>` Closes https://github.com/facebook/folly/pull/398 Reviewed By: ot Differential Revision: D3714957 Pulled By: yfeldblum fbshipit-source-id: 1c5d2538b674049f7e1872a0b623ec330dc8d7b2
-
- 21 Aug, 2016 3 commits
-
-
Christopher Dykes authored
Summary: It only needed a minor tweak, but the change still had to be made :( Reviewed By: andriigrynenko Differential Revision: D3745021 fbshipit-source-id: 286c6db706c3571842006537c6b17f506609e51d
-
Christopher Dykes authored
Summary: MSVC didn't like the conversion to using `Expected`, and, after `Expected` was fixed to work under MSVC, conv still needs more changes. Specifically MSVC doesn't understand the single-instantiation form of getting the last element, so we have to switch to a tuple-backed version instead, which requires more template instantions, but produces the same performance at runtime. Reviewed By: ericniebler Differential Revision: D3744063 fbshipit-source-id: affcab1574c721d8b9529784d7ca2a46233d9935
-
Bi Xue authored
Summary: When calling folly::to<SomeString>(double), generic implementation will firstly reserve 24 (or 25 when negative value) bytes. This will introduce a malloc call for most of mainstream string implementation. But for most cases, a floating point doesn't need 24 (or 25) bytes to be converted as a string. This diff try to introduce a special version which does not do string reserve. Reviewed By: ericniebler Differential Revision: D3728171 fbshipit-source-id: d70ead396ad6c8d0df1f542c5516f7534e82cb97
-
- 20 Aug, 2016 1 commit
-
-
Yedidya Feldblum authored
Summary: [Folly] An intro to the upgrade mutex in the `Synchronized` docs. Describes what the upgrade mutex is. Extends the existing docs which describe `Synchronized` and `LockPtr` interface and behavior in the presence of an upgrade mutex. Reviewed By: snarkmaster, simpkins Differential Revision: D3746177 fbshipit-source-id: 68b0570a36cc1f4393d5ccca535efa02752ca11d
-
- 19 Aug, 2016 8 commits
-
-
Aravind Anbudurai authored
Summary: Lets the kernel choose the port instead of hardcoding it. Reviewed By: djwatson Differential Revision: D3745911 fbshipit-source-id: d9680ec286e8015abb9274c30b572ff1d91548ce
-
Yedidya Feldblum authored
Summary: [Folly] Remove a dead comment in `folly/test/SynchronizedTest.cpp`. Reviewed By: simpkins Differential Revision: D3745609 fbshipit-source-id: acdbd3eaa6d947213b72fe13cec0291545a60c87
-
Christopher Dykes authored
Summary: Because it, and a whole bunch of other things, are used in the header but not properly included. Reviewed By: yfeldblum Differential Revision: D3744653 fbshipit-source-id: c10dbb83109200b6186b8ed5ef0d2447d4200f69
-
Christopher Dykes authored
Summary: Well, the explicit instantion for it anyways. The extern template declaration for it declares it as `noexcept`, so MSVC generates an error because the explicit instantiation is not also marked as `noexcept` Reviewed By: yfeldblum, ericniebler Differential Revision: D3744090 fbshipit-source-id: 4e756b2761c23a436097a6131b9b2ecd59faf4f9
-
Christopher Dykes authored
Summary: Because it is a portability header, but was created before portability headers were cool. Reviewed By: mzlee Differential Revision: D3743475 fbshipit-source-id: 5d2fe23ce08f0425ce48b4871fa660e69f57cc39
-
Aaryaman Sagar authored
Summary: This diff updates the documentation for folly::Synchronized to include upgradable locking Reviewed By: yfeldblum Differential Revision: D3740983 fbshipit-source-id: d201fcfa6f62ce168125d2a9caa096e079446efa
-
Andrii Grynenko authored
Summary: Make strict mode stricter, by not allowing singleton to be fetched after shutdown (even with try_get). Reviewed By: yfeldblum Differential Revision: D3737925 fbshipit-source-id: 8d5536c4f27e13feee722b5abeb15db6fe3d77bf
-
Aaryaman Sagar authored
Summary: This diff adds support for upgradeable locks to folly::Synchronized Reviewed By: yfeldblum Differential Revision: D3683205 fbshipit-source-id: 1b91ab07076566b4e5b535f2a2dbe1c8d9f3d1c2
-