- 07 Jul, 2014 10 commits
-
-
Tudor Bosman authored
Summary: wangle/detail.h -> wangle/detail/State.h Test Plan: OSS build Reviewed By: meyering@fb.com Subscribers: fugalh, lesha FB internal diff: D1421490
-
Tudor Bosman authored
Summary: Use namespace gflags going forward, import namespace google into it if backward. Also added a few "checking for..." messages in autoconf. Test Plan: fbconfig -r folly && fbmake runtests_opt, OSS build Reviewed By: meyering@fb.com Subscribers: fjargsto, ntv, jhj, lesha, kma, davejwatson FB internal diff: D1420575
-
Hans Fugal authored
Summary: Instead of returning a Later, `via` returns a cold future. This works without keeping a backreference like Later does, because an inactive Future will always activate on destruction. Alternatively we could have an extra Promise, a la Later, and pass that along like Later does, and require launch() at the end (though, implicit launching on destruction would be an option there too). If you think this approach is viable I'll clean it up on Wednesday: make sure all the calling sites work, etc. Test Plan: new unit test This may fail in contbuild, I haven't done the codemod for calling sites, if there are any. Reviewed By: hannesr@fb.com Subscribers: jsedgwick, net-systems@, fugalh, exa FB internal diff: D1412499 Tasks: 4480567
-
Hans Fugal authored
Summary: Bring a bit more sanity to the lifetime. Now Future and Promise detach by calling the respective methods on State, and they do it during their destruction only. State manages its own lifetime. Besides being cleaner, this also sets the stage for cancellation (where we'll need Future to hang on to its reference to State after setting the callback), and for folding in Later (we will have a bool for whether the future is hot and hold off executing the callback if it isn't). Also cleans up various things I noticed while auditing the code for usages of `state_`. Test Plan: All the unit tests still pass. Ran with ASAN (and found I had introduced a bug, then fixed it. yay) Reviewed By: hannesr@fb.com Subscribers: jsedgwick, net-systems@, fugalh, exa FB internal diff: D1412038 Tasks: 4618297
-
Hannes Roth authored
Summary: Suggested by @aalexandre. Test Plan: Compile. Reviewed By: andrei.alexandrescu@fb.com Subscribers: folly@lists, njormrod, aalexandre FB internal diff: D1246180
-
Lucian Grijincu authored
Test Plan: copied from folly::json Reviewed By: philipp@fb.com, soren@fb.com FB internal diff: D1417992 Tasks: 4527315
-
Hans Fugal authored
Summary: This isn't really an internal-to-this-class method. :-/ Test Plan: builds Reviewed By: hannesr@fb.com Subscribers: jsedgwick, net-systems@, fugalh, exa FB internal diff: D1412008
-
Hans Fugal authored
Summary: In the spirit of D1406753 Test Plan: still builds and tests pass Reviewed By: hannesr@fb.com Subscribers: jsedgwick, net-systems@, fugalh, exa FB internal diff: D1412002
-
Hans Fugal authored
Summary: codemod I never was satisfied with this name. `State` feels a little better. More descriptive. But still pretty generic, so I'm open to alternative ideas. Test Plan: It still builds and tests pass. Reviewed By: hannesr@fb.com Subscribers: jsedgwick, net-systems@, fugalh, exa FB internal diff: D1411506
-
Kevin Chou authored
Summary: The bug is when ignoreEmpty is true, we use the wrong token size, which will be 0 when last token is shorter than delimiter. Test Plan: 1. Add unit test 2. fbconfig -r folly && fbmake runtests Reviewed By: philipp@fb.com Subscribers: maxime, xiaol FB internal diff: D1415803
-
- 02 Jul, 2014 1 commit
-
-
Tudor Bosman authored
Test Plan: OSS Reviewed By: lesha@fb.com FB internal diff: D1415190 @override-unit-failures
-
- 01 Jul, 2014 4 commits
-
-
Dave Watson authored
Summary: Update targets so that gtest isn't required unless you run 'make check'. Simply make everything that uses gtest a 'check_PROGRAM' instead of a 'noinst_PROGRAM' Test Plan: build folly with 'make -j32', gtest isn't required. Reviewed By: andrewjcg@fb.com Subscribers: pavlo, doug FB internal diff: D1408288
-
Tudor Bosman authored
Summary: so #include <folly/File.h> works Test Plan: built OSS folly, make check, built tiny program out of tree Reviewed By: davejwatson@fb.com FB internal diff: D1412123
-
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
-