- 20 May, 2013 6 commits
-
-
Tom Jackson authored
Summary: Comparisons with values can lead to confusion, especially when the value itself is truthy. To avoid this confusion, I'm disabling comparison with contained value. Note that Optionals can still be constructed and assigned these values, but comparsion must be done separately for the container and the contained. Test Plan: Unit tests, contbuild Reviewed By: tudorb@fb.com FB internal diff: D783621
-
Tudor Bosman authored
Test Plan: ran it Reviewed By: lucian@fb.com FB internal diff: D787733
-
Adam Simpkins authored
Summary: The BucketedTimeSeries::rateHelper() function is generic, and not specific to the BucketedTimeSeries class. This diff moves it to folly/detail/Stats.h, so other parts of the stats code can access it as well. Test Plan: Ran the folly unit tests. Reviewed By: delong.j@fb.com FB internal diff: D778115
-
Adam Simpkins authored
Summary: Make rate() and countRate() more accurate when queried for a specific time range. Previously these functions divided the estimated sum/count by the entire time range specified. This underestimated the rate if we don't actually have data for the entire time period. (Since the sum computed only takes into account the time range for which we have data.) For example, if the timeseries duration was 60 seconds, but only 30 seconds of data had been entered so far, rate(now - 60, now) would underestimate the rate by half, since there was only 30 seconds worth of data available. The no-argument version of rate() did work correctly in that case. Test Plan: Added a new unit test for this behavior. Also fixed the existing rate test code, which had the same bug and expected the underestimated rate. Reviewed By: delong.j@fb.com FB internal diff: D778114
-
Philip Pronin authored
Summary: 21.4.2 [string.cons] / 23 says > If *this and str are the same object, the member has no effect. That means we have to support self-move-assignment. Test Plan: added test which triggered assertion, ran it Reviewed By: andrei.alexandrescu@fb.com FB internal diff: D785057
-
Tudor Bosman authored
Test Plan: test added Reviewed By: delong.j@fb.com FB internal diff: D783100
-
- 21 Apr, 2013 22 commits
-
-
Tudor Bosman authored
Summary: Seems like a good idea. Test Plan: compiled all of folly Reviewed By: delong.j@fb.com FB internal diff: D783104
-
Tudor Bosman authored
Test Plan: fbconfig $(find folly -name test) && fbmake runtests_opt Reviewed By: tjackson@fb.com FB internal diff: D777186
-
Tudor Bosman authored
Summary: Now that the third_party link was updated in https://phabricator.fb.com/D778617, we're good. Test Plan: fbconfig -r thrift && fbmake runtests_opt Reviewed By: chip@fb.com FB internal diff: D778707
-
Tudor Bosman authored
Summary: Unbreak build. third-party link not yet updated after https://phabricator.fb.com/D776457 Test Plan: no Reviewed By: chip@fb.com FB internal diff: D778669
-
Tudor Bosman authored
Summary: Cleaned up from common/strings/URL.h, and it should be URI, not URL. Test Plan: tests added Reviewed By: chip@fb.com FB internal diff: D768880
-
Christian Kamm authored
Summary: impl_.e_ += newB - impl_.b_; fails when the difference between newB and impl_.b_ isn't a multiple of sizeof(T). Test Plan: . Reviewed By: oyamauchi@fb.com FB internal diff: D774754
-
Tudor Bosman authored
Summary: We can't throw after the process is created, because we don't know what to do with it (and the Subprocess object goes up in smoke, so we can't rely on the caller to clean up, either). So don't throw. If we throw before the process is created, make sure we clean up. Test Plan: subprocess_test Reviewed By: delong.j@fb.com FB internal diff: D774722
-
Philip Pronin authored
Summary: folly/Range.h is extensively used in fbcode, try to avoid including <iostream> (which is pretty heavy), include forward declarations (<iosfwd>) instead. Also transitioned it from 'std type_traits' + 'boost type_traits' to 'std type_traits'. Test Plan: compiled, ran tests Reviewed By: soren@fb.com FB internal diff: D774834
-
Adam Simpkins authored
Summary: Move Histogram.h into the stats/ subdirectory, along side the BucketedTimeSeries code. Eventually I plan to land more of our stats code in this subdirectory too. This also renames Histogram-inl.h to Histogram-defs.h, and no longer includes it by default from Histogram.h. Instead, this adds a new stats/Instantiations.cpp file which explicitly instantiates Histogram<int64_t> and BucketedTimeSeries<int64_t>. Most callers use these instantiations, and they now no longer need to include Histogram-defs.h. Only callers that need other instantiations need to include Histogram-defs.h. This will speed up build times. Test Plan: Ran "arc unit" to build all projects depending on folly, and verified they all still built and passed tests. Reviewed By: ldbrandy@fb.com FB internal diff: D761377
-
Marcelo Juchem authored
Summary: rebinding allocators is too cumbersome, this diff implements a helper to make this job easier. Test Plan: unit test added Reviewed By: tudorb@fb.com FB internal diff: D766451
-
Marcelo Juchem authored
Summary: currently, StlAllocator<Alloc, void> can't be used when you want an untyped allocator that can be rebound later since it doesn't carry the SimpleAllocator pointer with it. This diff fixes that. Test Plan: unit test added Reviewed By: jon.coens@fb.com FB internal diff: D766559
-
Michael Connor authored
Summary: Clang throws error because the callback refers to itself inside its lambda function definition. I prevent this by declaring the variable first then the compiler does not complain when it is used within its lambda definition. folly/test/TimeoutQueueTest.cpp:99:37: error: variable 'cb' is uninitialized when used within its own initialization [-Werror,-Wuninitialized] Test Plan: fbconfig --clang --platform=gcc-4.7.1-glibc-2.14.1 --with-project-version boost:1.51.0 folly/test/ fbmake opt fbmake runtests_opt Reviewed By: ldbrandy@fb.com FB internal diff: D753061
-
Jonathan Coens authored
Summary: Create an artificial limit on an arena to start throwing bad_alloc before running out of system memory Test Plan: adjust unit test Reviewed By: marcelo.juchem@fb.com FB internal diff: D762695
-
Marcelo Juchem authored
Test Plan: all folly unit tests Reviewed By: andrewjcg@fb.com FB internal diff: D757374
-
Marcelo Juchem authored
Summary: A traits class to check for incomplete types Test Plan: unit tests added Reviewed By: delong.j@fb.com FB internal diff: D760676
-
Lucian Grijincu authored
Summary: A smaller function makes it more likely it will be inlined (it wasn't before, is now). Test Plan: n/a Reviewed By: tudorb@fb.com FB internal diff: D759996
-
Lucian Grijincu authored
Summary: A smaller function makes it more likely it will be inlined (it wasn't before, is now). Test Plan: n/a Reviewed By: tudorb@fb.com FB internal diff: D760000
-
Marcelo Juchem authored
Summary: Implementing as_stl_allocator as a companion to the existing make_stl_allocator Test Plan: unit tests added Reviewed By: jon.coens@fb.com FB internal diff: D755207
-
Misha Shneerson authored
Summary: HPHP compiler treats warnings as errors and the unused 'constuctor' variable breaks the build. Test Plan: Build Reviewed By: simpkins@fb.com FB internal diff: D759559
-
Tudor Bosman authored
Summary: Non-portable. Test Plan: test added Reviewed By: lucian@fb.com FB internal diff: D755528
-
Tudor Bosman authored
Test Plan: compile: fbconfig folly/experimental/io/test thrift/test unicorn/io/test common/system_features common/concurrency && fbmake opt Reviewed By: soren@fb.com FB internal diff: D753552
-
Brett Simmers authored
Test Plan: Built a program that uses it Reviewed By: tudorb@fb.com FB internal diff: D753460
-
- 27 Mar, 2013 12 commits
-
-
Tudor Bosman authored
Test Plan: fbconfig --platform=gcc-4.7.1-glibc-2.14.1-fb folly/test && fbmake runtests_opt Reviewed By: oyamauchi@fb.com FB internal diff: D749992
-
Louis Brandy authored
Summary: Two clang warnings. It wants user defined consturctor for static initialization, and it wants fwd-declare to agree with full decleration in regards to struct v class. Test Plan: `fbconfig --clang --platform=gcc-4.7.1-glibc-2.14.1 folly/test/` And make sure it doesn't break normal build. Reviewed By: tulloch@fb.com FB internal diff: D749857
-
Peter Griess authored
Summary: - Add a mode to ElfFile that allows opening the file for read/write access via PROT_WRITE. Test Plan: - Used it in some other code Reviewed By: simpkins@fb.com FB internal diff: D740184
-
Owen Yamauchi authored
Summary: Compile out the SSE versions of these functions in Range, based on a new entry in folly-config.h. The change to CpuId feels slightly iffy to me. It seems like it would be more rigorous to make compiling CpuId.h on non-Intel an error, and force clients to handle non-Intel platforms at the callsite. However, I think that would be too susceptible to unintentional breakage on non-Intel platforms, since most people (including automated systems) aren't building and testing regularly on any. Falling back to saying "none of these features exist on this processor" seems like a reasonable alternative. Test Plan: fbmake runtests, with FOLLY_HAVE_EMMINTRIN_H set to 0 and 1. Make sure the SSE functions are getting compiled in or out as appropriate. ##autoreconf## and ##./configure## to regenerate folly-config.h. Reviewed By: delong.j@fb.com FB internal diff: D746872
-
Peter Griess authored
Summary: - Add ElfFile::getSymbolByName(), which finds a Symbol object corresponding to the symbol w/ the given name - Add ElfFile::getSymbolValue(), which resolves the Symbol object to a value in the mapped file, following pointers if necessary Test Plan: - Unit tests Reviewed By: simpkins@fb.com FB internal diff: D740183
-
Peter Griess authored
Summary: - Make sure that the utility function Elf::at<T> only works for POD datatypes, as it uses reinterpret_cast<T>. Test Plan: - Unit tests Reviewed By: simpkins@fb.com FB internal diff: D748314
-
Peter Griess authored
Summary: - This is pretty similar to some stuff that we already have in Exception.h. Move (and rename) it. Test Plan: - Unit tests Reviewed By: simpkins@fb.com FB internal diff: D748313
-
Owen Yamauchi authored
Summary: Compile out instead of erroring. In an ideal world, we'd have a fallback that would work across platforms (i.e. no SSE, no unaligned 32-bit writes etc.) and compile some version of GroupVarint in all environments. I actually tried this; the SSE stuff is all behind #if __SSSE3__ already, so I thought it could work (modulo the unaligned-writes problem). I ran into problems with the SSSE3-vs.-not distinction that @simpkins alluded to in D652764, and decided I'd rather not open that can of worms at the moment. Test Plan: fbmake runtests. Manually force the #ifs to false and make sure fbmake runtests still passes (although GroupVarintTest is empty). Reviewed By: delong.j@fb.com FB internal diff: D747150
-
Louis Brandy authored
Summary: Go with the fat header approach. Merge these two into Memory.h. We could, potentially, include Malloc.h as well, but it fbstring header uses the once define for some special magic. Leave it alone for now. An alternate approach might be moving all three leaner headers into a `memory/` subdir with `folly/Memory.h` just #including the three. Test Plan: fbconfig folly/tests && fbmake runtests_opt Reviewed By: delong.j@fb.com FB internal diff: D745873
-
Mike Curtiss authored
Summary: Certain operations should not be performed on infinite sequences (e.g. sorting, left-folds, summation). In some cases, we can detect that a sequence is infinite at compile-time and provide a static_assert to prevent such dangerous operations. Test Plan: Manually created cases where the operation should be disallowed. Compiler correctly raised an error. Reviewed By: tjackson@fb.com FB internal diff: D740011
-
Louis Brandy authored
Summary: See title. Test Plan: Inspection. Reviewed By: delong.j@fb.com FB internal diff: D745883
-
Hans Fugal authored
Summary: Generate an `fbvector` of `struct iovec` suitable for using with `writev` or `sendmsg`. This code is pretty straightforward, but Adam pointed out that something along these lines has already been done in thrift, so I followed that code closely. http://fburl.com/11586814 Test Plan: fbmake runtests I am using also this in a prototype and it's working there. Reviewed By: agartrell@fb.com FB internal diff: D744055
-