- 01 Jul, 2014 2 commits
-
-
Tudor Bosman authored
Summary: Also changed the thrift compilers to emit code with <...>. Test Plan: fbconfig -r folly thrift && fbmake opt && fbmake runtests_opt Reviewed By: davejwatson@fb.com Subscribers: ruibalp, nli, shilin, tjackson, fugalh, alandau, bmatheny, njormrod FB internal diff: D1411225
-
Philip Pronin authored
Summary: As it turns out, `io_getevents` may actually return less than `min_nr` events. According to the aio logic (https://github.com/torvalds/linux/blob/10b5b5361a3c2a7fff9dbfa0f127adc2531e7732/fs/aio.c#L1634), there may be a couple of rounds required to get at least `nr_min` events, and if interrupted after the first one, incomplete results would be returned Test Plan: fbconfig -r folly/experimental/io/test && fbmake runtests_opt -32 and was no longer able to repro #4609062 Reviewed By: soren@fb.com FB internal diff: D1410389 Tasks: 4609062
-
- 27 Jun, 2014 10 commits
-
-
Joel Marcey authored
Summary: This prevents a linker error on OSX: ``` Undefined symbols for architecture x86_64: "folly::detail::EndianIntBase::swap(unsigned long)", referenced from: __GLOBAL__sub_I_MacAddress.cpp in libfolly.a(MacAddress.cpp.o) ld: symbol(s) not found for architecture x86_64 ``` We need folly and third-party changes in order to land a pull request for HHVM that starts to get FastCGI running on OSX. See the checklist of the HHVM pull request here: https://github.com/facebook/hhvm/pull/2944#issuecomment-47281003 Closes #68 GitHub Author: Daniel Sloof <goapsychadelic@gmail.com> @override-unit-failures Test Plan: fbmake runtests 100% Reviewed By: pt@fb.com, njormrod@fb.com FB internal diff: D1407426
-
Joel Marcey authored
Summary: A recent change in folly/MemoryMapping.cpp uses MAP_ANONYMOUS, which is named MAP_ANON on OSX/BSD. We need folly and third-party changes in order to land a pull request for HHVM that starts to get FastCGI running on OSX. See the checklist of the HHVM pull request here: https://github.com/facebook/hhvm/pull/2944#issuecomment-47281003 Closes #67 GitHub Author: Daniel Sloof <goapsychadelic@gmail.com> @override-unit-failures Test Plan: fbmake runtests 100% Reviewed By: pt@fb.com, njormrod@fb.com FB internal diff: D1407393
-
Hans Fugal authored
Summary: Stroke of brilliance, Hannes. Test Plan: unit tests, including a new one Looked through `fbgs 'via('` and all the extant `via`s are attached to `Later`s already so it shouldn't break anything. But check contbuild before commit. Reviewed By: hannesr@fb.com Subscribers: net-systems@, fugalh, exa FB internal diff: D1406976 Tasks: 4480567
-
Jim Meyering authored
Summary: * folly/test/DeterministicSchedule.cpp (folly): Tao/queues tests exposed an unhandled case in this code: when (futex->data == expected) happens, we would call futexErrnoToFutexResult with a futexErrno value of 0, which would cause an abort (unhandled valued in switch). Here's a stack trace from the abort: https://phabricator.fb.com/P12558008 showing the invalid futexErrno value in frame #4. Test Plan: fbconfig -r --platform-all=gcc-4.8.1-glibc-2.17 --sanitize=address tao/queues:TimeoutWorkQueueTests _bin/tao/queues/WorkQueueTests -fbunit_test_regexp '^mt\_stress\_deterministic$' Reviewed By: mssarang@fb.com FB internal diff: D1404572 Tasks: 4494871
-
Sarang Masti authored
Summary: Handle wake-ups correctly in futexWaitUntilImpl. Test Plan: -- ran all folly unit tests -- ran TimeoutWorkQueue test under tao/queues Reviewed By: ngbronson@fb.com, meyering@fb.com FB internal diff: D1406845 Tasks: 4494871
-
Hans Fugal authored
Summary: to make lint happy Test Plan: builds Reviewed By: hannesr@fb.com Subscribers: net-systems@, fugalh, exa FB internal diff: D1406766 Tasks: 4480567
-
Hans Fugal authored
Summary: The word "continuation" is too ambiguous. Prefer callback (except where we are actually talking about CSP continuations in the README). Test Plan: Still builds. Nothing external is or should be calling `setContinuation`. But I'll wait for contbuild anyway. Reviewed By: hannesr@fb.com Subscribers: net-systems@, fugalh, exa FB internal diff: D1406753 Tasks: 4480567
-
Hans Fugal authored
Summary: Removing this crufty API. The only callsite for `executeWith` was `Later::via` so I just folded it in there. Test Plan: unit tests contbuild Reviewed By: hannesr@fb.com Subscribers: net-systems@, fugalh, exa FB internal diff: D1406592 Tasks: 4480567
-
Hans Fugal authored
Summary: I have no idea why the compiler is gettings its britches in a bunch because a unit test has a predictable output. Really, gcc?! But whatever, avoiding inlining by putting it in the cpp file solves it. Test Plan: fbmake runtests_opt Reviewed By: davejwatson@fb.com Subscribers: net-systems@, fugalh, exa FB internal diff: D1405811 Tasks: 4591823
-
Hans Fugal authored
Summary: Add the `QueuedImmediateExecutor` which behaves like `InlineExecutor` but with different (and usually better) ordering semantics for nested calls. @override-unit-failures Test Plan: unit tests Reviewed By: davejwatson@fb.com Subscribers: folly@lists, net-systems@, fugalh, exa FB internal diff: D1364904 Tasks: 3789661
-
- 26 Jun, 2014 10 commits
-
-
Tudor Bosman authored
Reviewed By: meyering@fb.com Test Plan: no
-
Tudor Bosman authored
Summary: Also, optionalize dependencies on compression libraries. Test Plan: fbconfig -r folly && fbmake runtests_opt Reviewed By: meyering@fb.com Subscribers: kma, jhj, simpkins, lesha, folly@lists FB internal diff: D1396573
-
Anton Likhtarov authored
Summary: On 12.04, there's both /usr/lib/libiberty.a and /usr/lib/libiberty_pic.a, and _pic is the one we want to build a Folly shared library. Test Plan: build on Ubuntu 12.04 Reviewed By: meyering@fb.com FB internal diff: D1402194
-
Hans Fugal authored
Summary: and ManualExecutor implementation Test Plan: unit tests, contbuild Reviewed By: davejwatson@fb.com Subscribers: bmatheny, folly@lists, net-systems@, fugalh, exa, marccelani, jsedgwick FB internal diff: D1392999 Tasks: 4548494
-
Tudor Bosman authored
Summary: Also, optionalize dependencies on compression libraries. Test Plan: fbconfig -r folly && fbmake runtests_opt Reviewed By: meyering@fb.com Subscribers: kma, jhj, simpkins, lesha, folly@lists FB internal diff: D1396573
-
Tudor Bosman authored
Summary: Because @lesha asked "why not" and I couldn't give him an answer. Test Plan: random_test Reviewed By: bmaurer@fb.com Subscribers: bmaurer, folly@lists, jhj, kma, lesha, sdoroshenko, soren FB internal diff: D1394401
-
Peter Ruibal authored
Summary: fbthrift depends on <folly/ThreadName.h>, which isn't currently getting installed as part of the autotools build. Add it to Makefile.am Test Plan: Made this change to folly, re-autogen/configure/install, and then was able to successfully compile fbthrift's compiler Reviewed By: davejwatson@fb.com Subscribers: doug, folly@lists FB internal diff: D1397084
-
Yunqi Zhang authored
Summary: This diff allows users to loop through EventBase without blocking if there are not any events to process. This is useful for sending and receiving requests on network, where users just want to try if there are any events and do not want to block if not. https://phabricator.fb.com/D1373887 is an example where we find this feature useful, otherwise we have to add an empty callback before loop. event_base_.runInLoop([] {}); event_base_.loopOnce(); @davejwatson, @fugalh, @simpkins, @stepan: Could you please take a look at the proposed changes and let me know if there is any better ways of doing this. Thank you! Test Plan: I think this would not break anything, but we might want to do some performance profiling if needed. Reviewed By: hans@fb.com Subscribers: simpkins, davejwatson, fugalh, stepan, folly@lists FB internal diff: D1383401
-
Nicholas Ormrod authored
Summary: Some libgcc-incompatible code has been added to fbstring. Removed/reorganized it so that we can drop fbstring right into libgcc. Test Plan: fbconfig -r folly && fbmake runtests Copied FBString.h into libgcc's basic_fbstring.h, with no modifications. Successfully tp2_build libgcc/4.8.1. Adjusted symlink, then fbmake clean && fbconfig -r folly && fbmake dbg. The fbmake dbg failed with an assertion error, which is consistent with @lucian's observations in D1373725; the important part is that the error was at runtime, so the compile-time changes of this diff looks good. Reviewed By: lucian@fb.com Subscribers: folly@lists, sdwilsh, njormrod, lucian FB internal diff: D1382873
-
Nicholas Ormrod authored
Summary: Now that fbstring is conservative by default (D1373308), we can remove the mutability of the data members and the call to c_str() in operator[]. Test Plan: fbconfig -r folly && fbmake runtests Reviewed By: lucian@fb.com Subscribers: folly@lists, sdwilsh, njormrod FB internal diff: D1382644
-
- 14 Jun, 2014 5 commits
-
-
Anton Likhtarov authored
Test Plan: build it Reviewed By: pavlo@fb.com Subscribers: folly@lists FB internal diff: D1383722
-
Lucian Grijincu authored
Test Plan: ran folly tests Reviewed By: njormrod@fb.com Subscribers: folly@lists, njormrod FB internal diff: D1373308
-
Nicholas Ormrod authored
Summary: @lucian's D1373308 set fbstring to conservative by default. This breaks, eg, ti/proxygen/httpclient tests, by failing an assertion inside of c_str(). Specifically, the terminator is not '\0'. The fbstring_core move constructor, when sourced by a MediumLarge string, steals the source's internal data, then resets the source by calling ##setSmallSize(0)##. That function sets the in-situ size of the fbstring to zero, thus requalifying the string as a small string; however, it does nothing to the data - the previous 23 bytes now contain garbage. Sources of a move must be in a consistent state after the move is complete. The source, once a MediumLarge string whose first eight bytes were a pointer, is now a small string of size zero whose first byte is not necessarily '\0'. This breaks the FBSTRING_CONSERVATIVE invariant. This can be fixed by writing a terminator after the setSmallSize call. I have fixed all setSmallSize locations that do not writeTerminator. fbstring_core's move constructor is called exclusively from basic_fbstring's move assignment operator, hence the odd format of the test case. == TMI == Interestingly, the source will almost certainly* contain a '\0', which prevents this simple ##str.size() != strlen(str.c_str())## bug from turning into a memory-trampling monster. The new size of zero is not what saves us - the 'size' byte of a small fbstring, through a very clever trick to allow 23-byte in-situ strings, is actually 23 minus the actual size (now 0), so is 23! Where, then, does the '\0' byte come? A MediumLarge string's data layout is [pointer, size, capacity]. The pointer is not guaranteed to contain a '\0', and neither are size or capacity. However, the size of the string needs to be very large in order to force the top byte of the size member to be non-zero; in that case, the string is so large that malloc is returning memory by the page. Since page sizes are a multiple of 2^8 (almost always, and if not then I don't think your fbstring can support large enough sizes anyways), and we use goodMallocSize, the capacity pointer would have a least signfigicant byte of zero. Why the (*)? Well, when reserving extra space on a non-refcounted Large string, the reallocation does not yield its extra goodMallocSize space. This could be fixed, though probably isn't worth the trouble. Anyways, since we aren't goodMallocSize-ing the user-supplied requested capacity, it probably won't contain a '\0'. Test Plan: fbconfig -r folly && fbmake runtests Modify folly/test/FBStringTest.cpp to define FBSTRING_CONSERVATIVE, then fbconfig folly/test/:fbstring_test_using_jemalloc && fbmake runtests Note that this fails before the patch is applied. Note that it is possible for the tests to pass even when this bug is present, since the top byte of the heap pointer must be non-0 in order for this error to be triggered. Reviewed By: lucian@fb.com Subscribers: folly@lists, njormrod, lucian, markisaa, robbert, sdwilsh, tudorb, jdelong FB internal diff: D1376517
-
Nicholas Ormrod authored
Summary: Some asserts could be static_asserts. Make it so! Test Plan: fbconfig -r folly && fbmke opt && fbmake runtests_opt Reviewed By: lucian@fb.com Subscribers: folly@lists, sdwilsh, njormrod FB internal diff: D1378670
-
Vojin Katic authored
Summary: I made it work, but please send your feedback how to improve code quality. splitByLine will split on \r, \n, and \r\n. Test Plan: add new test, arc unit Reviewed By: tjackson@fb.com Subscribers: folly@lists, crawler-diffs@ FB internal diff: D1322212
-
- 09 Jun, 2014 13 commits
-
-
Jim Meyering authored
Summary: Without this, we'd see problems like this in tao, when building with clang: With this change, this now works with clang-3.4 and clang.dev (3.4+). This change reverts D950285, which change appears to have been made to accommodate weakness in clang-3.3 or older. In file included from tao/data_providers/common/simpledp.cpp:7: ./tao/data_providers/common/stats.h:175:18: error: no type named 'RWTicketSpinLockT' in namespace 'folly' typedef folly::RWTicketSpinLockT<64, true> RWLockType; ~~~~~~~^ ./tao/data_providers/common/stats.h:175:35: error: expected member name or ';' after declaration specifiers typedef folly::RWTicketSpinLockT<64, true> RWLockType; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ Test Plan: ensure that all of these pass: fbconfig -r --clang folly/test:rw_spinlock_test && fbmake runtests fbconfig -r --clang folly/test:rw_spinlock_test && fbmake runtests_opt fbconfig -r folly/test:rw_spinlock_test && fbmake runtests_opt fbconfig -r --clang --with-project-version clang:dev \ folly/test:rw_spinlock_test && fbmake runtests_opt Reviewed By: delong.j@fb.com Subscribers: folly@lists, mathieubaudet FB internal diff: D1370024 Tasks: 4090011
-
Zejun Wu authored
Summary: Avoid copying underlying char array in to<string>(const string&) and to<fbstring>(const fbstring&). Test Plan: fbconfig -r $redteamisthebestteam/$nekomikoreimu && fbmake Reviewed By: ldbrandy@fb.com Subscribers: jonp, folly@lists FB internal diff: D1368183 Tasks: 4263125
-
Marcus Holland-Moritz authored
Summary: I'm looping through a large number of test cases in a benchmark and I'm interested in the average time per test case rather than the total time, which is what I'm currently seeing. In order to get the average time, I need to be able to tell the benchmark module how many iterations have been run. This change adds _MULTI variants of the different BENCHMARK_ macros that allow for returning the actual number of iterations that have been run, e.g.: BENCHMARK_MULTI(benchmarkSomething) { std::vector<int> testCases { 0, 1, 1, 2, 3, 5 }; for (int c : testCases) { doSomething(c); } return testCases.size(); } Test Plan: * fbconfig -r folly && fbmake runtests * added new test cases to example benchmark code Reviewed By: simpkins@fb.com Subscribers: folly@lists, london_search@ FB internal diff: D1356437
-
Philip Pronin authored
Summary: D1318048#21 @override-unit-failures Test Plan: fbconfig -r folly && fbmake runtests_opt -j32 Reviewed By: njormrod@fb.com Subscribers: folly@lists, njormrod FB internal diff: D1368939 Tasks: 4466412 Blame Revision: D1318048
-
Stepan Palamarchuk authored
Summary: This change allows users to track lifetime of EventBase and perform clean shutdown when EventBase gets destructed. It is useful for users that rely on EventBase lifetime, but don't have any feedback mechanism with the owner of EventBase. For instance some part of code might remain running in background on the EventBase after the main object was destroyed (e.g. it might be finalizing some async requests). In such case the original owner doesn't know that there's something still running and may try to destroy EventBase. In that case such background code will remain zombie forever. AsyncMcClient changes are presented just as an example of usage. @davejwatson, @simpkins: Could you please take a look at the proposed changes for the EventBase? If this is something not worth adding into EventBase, could you recommend a better way of doing things? Test Plan: fbmake runtests Reviewed By: alikhtarov@fb.com Subscribers: folly@lists, simpkins, davejwatson FB internal diff: D1353101
-
Marcelo Juchem authored
Summary: more flexibility for using functors with split_step Test Plan: unit tests added + arc unit Reviewed By: ldbrandy@fb.com Subscribers: folly@lists FB internal diff: D1362644
-
Tudor Bosman authored
Test Plan: test added Reviewed By: davejwatson@fb.com Subscribers: folly@lists FB internal diff: D1359469
-
Matt Dordal authored
Summary: It might be useful to be able to wait for some time (but not forever) on a future, so this is a shot at doing that. It's a very heavyweight implementation, however. Since the current interface for waitWithSemaphore doesn't really make sense if the timeout fires, change it to return a Future<T>. Test Plan: unit tests Reviewed By: hans@fb.com Subscribers: trunkagent, folly@lists, fugalh FB internal diff: D1358230
-
Jon Purdy authored
Summary: C++14 adds this overload but I wanted it today. Test Plan: It compiles, and this is the definition described in the standard. Reviewed By: xning@fb.com Subscribers: folly@lists FB internal diff: D1338839
-
Philip Pronin authored
Summary: Accidentally spotted this problem. `folly/FileUtil.h` and `common/files/FileUtil.h` are now using `*NoInt` wrappers where appropriate. Test Plan: fbconfig -r common/files folly && fbmake opt -j32 Reviewed By: lucian@fb.com Subscribers: folly@lists, fbcode-common-diffs@lists FB internal diff: D1356261
-
Tom Jackson authored
Summary: I was confused by it, thought rephrasing might help. Test Plan: Read Reviewed By: tudorb@fb.com Subscribers: folly@lists FB internal diff: D1315612
-
Dave Watson authored
Summary: Currently notification queue does 2 syscalls per item: one read, one write. We only need the eventfd to notify to wake up the thread, so instead, if the thread is already awake, don't bother writing to the fd. Benchmark shows that when the queue size() > 1, this is ~4x faster. Note that this might be unfair if there are multiple consumers: I could imagine a situation where one thread eats all the wakeups written to the fd, so only one thread is actually working. However, multiple consumers is a bad idea anyway, and I'd consider removing it entirely: If the same fd is in multiple epoll() loops, _all_ epolls will wake up, resulting in a thundering herd problem. I don't see any multiConsumer cases in fbcode Using EFD_SEMAPHORE or not doesn't seem to matter, since hopefully we're only writing 1 wakeup per thread - and it wouldn't work at all for multiConsumer case. Test Plan: fbconfig thrift/lib/cpp/test:TNotificationQueueTest; fbamke runtests fbconfig common/concurrency:QueueBenchmark fbmake opt QueueBenchmark --bm_min_iters=10000 Reviewed By: afrind@fb.com Subscribers: doug, folly@lists, fbcode-common-diffs@lists, alandau, bmatheny, haijunz FB internal diff: D1272872 Tasks: 2802758
-
Jim Meyering authored
Summary: This code fails to compile with clang:dev, so don't try for now. * folly/wangle/test/Thens.cpp: Don't attempt to compile test/Thens.cpp. See 4412111 for details. Prompted by clang:dev+MSAN effort, 4090011. Test Plan: Run this: fbconfig --clang --with-project-version clang:dev -r folly/wangle fbmake runtests Failed before, passes with this patch. Reviewed By: hans@fb.com Subscribers: folly@lists, fugalh FB internal diff: D1354751 Tasks: 4090011, 4412111
-