1. 15 Oct, 2013 20 commits
    • Peter Griess's avatar
      Fix ifunc test in configure.ac to make unknown attribute warnings fatal. · c6e51ca2
      Peter Griess authored
      Summary:
      - By default, GCC only warns on unknown attributes. As a result our
      FOLLY_HAVE_IFUNC test doesn't actually catch instances where we don't
      support this.
      
      Test Plan:
      - fbconfig -r folly && fbmake runtests
      - ./configure && make check on Ubuntu/FC/Mac
      
      Reviewed By: oyamauchi@fb.com
      
      FB internal diff: D998506
      c6e51ca2
    • Peter Griess's avatar
      Pass 'nostdinc' to AM_INIT_AUTOMAKE(). · 1a732b02
      Peter Griess authored
      Summary:
      - On hosts with case-insensitive filesystems, adding folly/ directory to
      the include path causes String.h to get picked up as <string.h>. Add
      'nostdinc' to the AM_INIT_AUTOMAKE() invocation to remove these
      standard includes from the set of compile flags.
      
      Test Plan:
      - fbconfig -r folly && fbmake runtests
      - ./configure && make check on Ubuntu/FC/Mac
      
      Reviewed By: delong.j@fb.com
      
      FB internal diff: D998505
      1a732b02
    • Peter Griess's avatar
      Clean up use of Boost and PThread libraries. · de4088dd
      Peter Griess authored
      Summary:
      - Use AM_LDFLAGS rather than AM_CXXFLAGS to link against Boost.
      - Link against $(BOOST_REGEX_LIB) in addition to other Boost libs.
      - Add $(BOOST_LDFLAGS) to AM_LDFLAGS so that we get the library path
      that we configured Boost to use.
      - Add -lpthread to AM_LDFLAGS rather than ad-hoc '-lpthread' additions
      to various library builds.
      
      Test Plan:
      - fbconfig -r folly && fbmake runtests
      - ./configure && make check on Ubuntu/FC/Mac
      
      Reviewed By: oyamauchi@fb.com
      
      FB internal diff: D998504
      de4088dd
    • Peter Griess's avatar
      Add missing ax_boost_system.m4. · 28312163
      Peter Griess authored
      Summary:
      - Link ConcurrentSkiplistBenchmark with $(BOOST_SYSTEM_LIB) to resolve
      linker errors for boost::system symbols.
      
      Test Plan:
      - fbconfig -r folly && fbmake runtests
      - ./configure && make check on Ubuntu/FC/Mac
      
      Reviewed By: oyamauchi@fb.com
      
      FB internal diff: D998503
      28312163
    • Soren Lassen's avatar
      Added initializer_list ctors to sorted_vector_{set,map} · 1db90a14
      Soren Lassen authored
      Test Plan: unittest
      
      Reviewed By: tudorb@fb.com
      
      FB internal diff: D987910
      1db90a14
    • Soren Lassen's avatar
      Support constexpr StringPiece. · 21f20989
      Soren Lassen authored
      Test Plan: fbconfig folly/test --platform=gcc-4.8.1-glibc-2.17 && fbmake dbg _bin/folly/test/range_test && _bin/folly/test/range_test
      
      Reviewed By: tudorb@fb.com
      
      FB internal diff: D989142
      21f20989
    • Tim Hanson's avatar
      Add MaxString<__uint128_t> · 14fde8ae
      Tim Hanson authored
      Summary: For GCC 3.6+, define a template specialization for MaxString<__uint128_t>.
      
      @override-unit-failures
      
      Test Plan: Unit tests
      
      Reviewed By: andrei.alexandrescu@fb.com
      
      FB internal diff: D995290
      14fde8ae
    • Rajat Goel's avatar
      Add bad input to Uri in exception messages · 3437a028
      Rajat Goel authored
      Summary:
      It helps if you can directly see the offending URI from the error
      message (specially when you dont want to handle errors and let process crash).
      
      @override-unit-failures
      
      Test Plan: unit-tests
      
      Reviewed By: andrei.alexandrescu@fb.com
      
      FB internal diff: D993025
      3437a028
    • Louis Brandy's avatar
      add functions to return string's internal pointers · e3a49e3d
      Louis Brandy authored
      Summary: See title. This avoids unnecessary copies when needing to access string data directly. These will throw if the dynamic isn't a string.
      
      @override-unit-failures
      
      Test Plan: Unit test.
      
      Reviewed By: delong.j@fb.com
      
      FB internal diff: D986331
      e3a49e3d
    • Daniel Sommermann's avatar
      Add a comment about takeOwnership() · 524d0e74
      Daniel Sommermann authored
      Summary:
      It is dangerous to pass memory into an IOBuf since usually in C++
      programs, memory is allocated using `new`, while IOBuf by default frees
      memory that it has taken ownership of with `free()`. For now, add a
      comment warning about this (address sanitizer will warn you about this
      when it happens in a live process).
      
      Test Plan: NA
      
      Reviewed By: tudorb@fb.com
      
      FB internal diff: D990056
      
      @override-unit-failures
      524d0e74
    • Tudor Bosman's avatar
      Fix bad bug in folly::ThreadLocal · 762965ce
      Tudor Bosman authored
      Summary:
      There were a few bugs, actually:
      
      1. prevSize < jemallocMinInPlaceExpandable compared an element count with
      a byte size; this hid the next bug for a while (as we needed 4096
      ThreadLocalPtr objects in order to trigger it)
      
      2. if rallocm(... ALLOCM_NO_MOVE) succeeds in expanding in place, we don't
      increment elementsCapacity_, which is bad.
      
      Switched to allocm() so we always take advantage of all memory that was
      actually allocated.
      
      @override-unit-failures
      Clearly unrelated
      +Warning: This development build of composer is over 30 days old. It
      is recommended to update it by running
      "hphp/test/slow/ext_phar/composer.php self-update" to get the latest
      version.
      
      Test Plan: test added, which failed before and doesn't any more
      
      Reviewed By: lucian@fb.com
      
      FB internal diff: D987009
      762965ce
    • Tudor Bosman's avatar
      Add declaration for allocm · 6d372314
      Tudor Bosman authored
      Test Plan: compiled
      
      Reviewed By: lucian@fb.com
      
      FB internal diff: D986998
      6d372314
    • Louis Brandy's avatar
      add test for numeric -> string conversions · 442a46c3
      Louis Brandy authored
      Summary: We don't test this functionality (pulling a number out as a string). Almost commited a bug this would have caught.
      
      Test Plan: Run the test.
      
      Reviewed By: delong.j@fb.com
      
      FB internal diff: D987607
      442a46c3
    • Tom Jackson's avatar
      dynamic::get_ptr · 7eccc5a3
      Tom Jackson authored
      Summary: For testing containment and using the value in one operation.
      
      Test Plan: Unit tests
      
      Reviewed By: tudorb@fb.com
      
      FB internal diff: D986986
      7eccc5a3
    • Nicholas Ormrod's avatar
      Tidied up some includes. · e32d53e9
      Nicholas Ormrod authored
      Summary: Changed #include "..." to #include <...> where possible.
      
      Test Plan: recompile
      
      Reviewed By: delong.j@fb.com
      
      FB internal diff: D986803
      e32d53e9
    • Philip Pronin's avatar
      File::dup · c7854d92
      Philip Pronin authored
      Test Plan: fbconfig -r folly && fbmake opt -j32
      
      @override-unit-failures
      
      Reviewed By: soren@fb.com
      
      FB internal diff: D985595
      c7854d92
    • Stephane Sezer's avatar
      Fix performance issues with folly::Uri::authority(). · 2c3828bc
      Stephane Sezer authored
      Summary: String concatenation was not performed correctly in folly::Uri::authority(). This commit fixes the issue by pre-allocating enough space and buliding the string left to right.
      
      Test Plan: Unit tests in folly/test.
      
      Reviewed By: tudorb@fb.com
      
      FB internal diff: D981069
      2c3828bc
    • Tudor Bosman's avatar
      Add noexcept specification for move ctor, move assignment, dtor in fbstring · cca262b3
      Tudor Bosman authored
      Test Plan: fbstring_test, test added
      
      Reviewed By: ngbronson@fb.com
      
      FB internal diff: D983278
      cca262b3
    • Andrew Gallagher's avatar
      folly: add a FOLLY_SANITIZE_ADDRESS macro to Portability.h · d3468ea8
      Andrew Gallagher authored
      Summary:
      Defines a macro to portably test whether address sanitizer is
      enabled across the different compilers we use.
      
      Test Plan:
      Compiled source file with address sanitizer and verified macro
      was defined.
      
      Reviewed By: delong.j@fb.com
      
      FB internal diff: D978196
      d3468ea8
    • Stephane Sezer's avatar
      Add an authority() method to folly::Uri. · 464cc74d
      Stephane Sezer authored
      Summary: facebook::strings::URL has an authority() method. Having the same thing for folly::Uri help converting users of the URL class. This method just takes username, password, host, and port, and builds a string in the form <username>:<password>@<host>:<port>.
      
      Test Plan: None.
      
      Reviewed By: rajat@fb.com
      
      FB internal diff: D977450
      464cc74d
  2. 22 Sep, 2013 14 commits
    • Louis Brandy's avatar
      deprecating boost::shared_ptr · a88ef0be
      Louis Brandy authored
      Summary:
      Replacing boost::shared_ptr with std::shared_ptr.
      
      Test Plan: .
      
      Reviewed By: andrei.alexandrescu@fb.com
      
      FB internal diff: D932119
      a88ef0be
    • Tudor Bosman's avatar
      Fix small race in subprocess_test · 253f44cb
      Tudor Bosman authored
      Summary:
      It is possible for subprocess_test_parent_death_helper's child to signal
      the parent between the check for "caught" and the call to "pause()", and
      therefore pause() blocks forever.
      
      Test Plan: ran the test in a loop
      
      Reviewed By: delong.j@fb.com
      
      FB internal diff: D979872
      253f44cb
    • Tudor Bosman's avatar
      Add various functions to wrapNoInt · 5675ef27
      Tudor Bosman authored
      Test Plan: used them
      
      Reviewed By: soren@fb.com
      
      FB internal diff: D976393
      5675ef27
    • Tudor Bosman's avatar
      Fixed-size atomic bitset · c63b363e
      Tudor Bosman authored
      Summary: No magic; what it says on the package.
      
      Test Plan: atomic_bitset_test
      
      Reviewed By: delong.j@fb.com
      
      FB internal diff: D971875
      c63b363e
    • Max Wang's avatar
      Parametrize allocator in AtomicHash{Array,Map} · 2129f9b5
      Max Wang authored
      Summary: Maybe at some point somebody won't want malloc, e.g. me.
      
      Test Plan: Ran AtomicHashArrayTest using an mmap allocator.
      
      Reviewed By: delong.j@fb.com
      
      FB internal diff: D960192
      2129f9b5
    • Stephane Sezer's avatar
      Make folly::Uri::port() return uint16_t instead of uint32_t. · 4c787a9d
      Stephane Sezer authored
      Summary: We can safely assume that ports are always going to be 16bit (TCP or UDP), so no need to have a uint32_t here.
      
      Test Plan: Ran tests in folly/tests.
      
      Reviewed By: tudorb@fb.com
      
      FB internal diff: D973291
      4c787a9d
    • Stephane Sezer's avatar
      Remove problematic log lines from folly JSON test. · ffd25cf7
      Stephane Sezer authored
      Summary: We are logging UTF-8 data in this test. This makes the test infra fail (when using `fbmake runtests` for example).
      
      Test Plan: Run existing JSON tests.
      
      Reviewed By: shreehari@fb.com
      
      FB internal diff: D975249
      ffd25cf7
    • Andrey Goder's avatar
      fix minor typo in comment · 8071c1e0
      Andrey Goder authored
      Test Plan: n/a
      
      Reviewed By: delong.j@fb.com
      
      FB internal diff: D970791
      8071c1e0
    • Altan Alpay's avatar
      AsyncIO::initializeContext() should provide more debug output when io_queue_init fails · 5af17ef1
      Altan Alpay authored
      Summary: It would be good idea to provide more information if the io_queue_init() failed due to resource allocation.
      
      Test Plan:
      Run standart tests + manual testing
      1. fbconfig -r folly/experimental/ && fbmake runtests
      2. Ask a capacity larger than aio_max_nr and check failure messages
      
      Reviewed By: agartrell@fb.com
      
      FB internal diff: D965260
      5af17ef1
    • Philip Pronin's avatar
      fix memcpy-param-overlap (asan) in GroupVarint · 6e442037
      Philip Pronin authored
      Test Plan: .
      
      Reviewed By: tudorb@fb.com
      
      FB internal diff: D962972
      6e442037
    • Andrew Gallagher's avatar
      folly: don't inline functions with ASAN disabled · 95201d11
      Andrew Gallagher authored
      Summary:
      The address sanitizer disabling attribute has some issues in gcc when
      the function is inlined.
      
      Test Plan: Built and ran tao tests with ASAN.
      
      Reviewed By: philipp@fb.com
      
      FB internal diff: D962930
      95201d11
    • Nicholas Ormrod's avatar
      range checks in DynamicConverter · 6a7ee8aa
      Nicholas Ormrod authored
      Summary:
      Add range-checking to convertTo for small numeric types.
      
      Internally, dynamics represent a numeric with an int64_t or a double.
      When converting to a smaller numeric type, DynamicConverter uses a
      static_cast. This causes some confusion (re D936940). The code now uses
      folly::to, which throws a std::range_error on overflow.
      
      While working on this I also added some light comments to the new
      toDynamic section, for consistency with the original convertTo
      commenting. I also renamed the internal trait is_associative_container
      to is_map, since is_associative_container is looking for a mapped_type
      typedef and hence excludes such associative containers as sets.
      
      While adding the overflow tests, I also augmented the typetraits test to
      include the is_map and is_range traits, which hitherto had no test
      coverage.
      
      Test Plan: build and run tests, both in dbg and opt
      
      Reviewed By: cberner@fb.com
      
      FB internal diff: D961605
      6a7ee8aa
    • Philip Pronin's avatar
      disable asan for qfind_first_byte_of_needles16 · 5f19afe7
      Philip Pronin authored
      Summary:
      It's expected to read past the string (within the same memory
      page).
      
      Test Plan: .
      
      Reviewed By: tudorb@fb.com
      
      FB internal diff: D962974
      5f19afe7
    • Philip Pronin's avatar
      fix heap-buffer-overflow (asan) in EliasFanoCoding · 3c40a0b6
      Philip Pronin authored
      Test Plan:
      fbconfig folly/experimental/test:elias_fano_test && fbmake runtests_opt
      
      Reviewed By: tudorb@fb.com
      
      FB internal diff: D962971
      3c40a0b6
  3. 08 Sep, 2013 5 commits
    • Jordan DeLong's avatar
      Some fixes for building stuff with clang · ec0da690
      Jordan DeLong authored
      @override-unit-failures
      
      Summary: Not that much.
      
      Test Plan:
      Compiled hphp with clang.
      
      Reviewed By: oyamauchi@fb.com
      
      FB internal diff: D954663
      ec0da690
    • Andrew Gallagher's avatar
      folly: disable address sanitizer warnings on fbstring · 91199bbe
      Andrew Gallagher authored
      Summary:
      The fbstring constructor does word-aligned copies which may creep
      past the end of the C string, which address sanitizer doesn't like.
      
      This also adds a address-sanitizer-disabling-attribute to both
      Portability.h (for general use) and a (gross) copy in FBString.h
      since it gets put into libstdc++.
      
      Test Plan: ran address sanitizer on folly tests
      
      Reviewed By: andrei.alexandrescu@fb.com
      
      FB internal diff: D950586
      91199bbe
    • bsimmers's avatar
      abort instead of throwing an exception on bad format strings · 9bfa4150
      bsimmers authored
      Summary:
      Errors that happen during format are almost always programmer
      error in the form of a bad format string. Abort instead of throwing in
      these cases.
      
      Test Plan: automated tests, added a couple new tests
      
      Reviewed By: tudorb@fb.com
      
      FB internal diff: D947470
      9bfa4150
    • Dave Watson's avatar
      x86intrinsic seems to be problematic for clang · 38220af4
      Dave Watson authored
      Summary: fbinject (clang code parser) throws some errors when
      including the x86intrinsic header.
      
      Test Plan:
      D929356 compiles after this diff.  It adds a dep on RWSpinLock.
      
      Reviewed By: beng@fb.com
      
      FB internal diff: D950285
      38220af4
    • Tudor Bosman's avatar
      Fix insignificant CRTP bug · e16c0109
      Tudor Bosman authored
      Summary:
      
      @override-unit-failures
      Flaky unit tests passed on the second try, but the git hook still
      complains
      
      Test Plan: iobuf_cursor_test
      
      Reviewed By: philipp@fb.com
      
      FB internal diff: D948768
      e16c0109
  4. 29 Aug, 2013 1 commit
    • Sean Cannella's avatar
      fix folly build on OSX with gcc 4.8 · 879dfa05
      Sean Cannella authored
      Summary:
      - gcc 4.8 + boost 1.53 do not like the Oxford comma in template
      arguments
      
      Test Plan: compiled on OSX with gcc 4.8 and boost 1.53
      
      Reviewed By: andrei.alexandrescu@fb.com
      
      FB internal diff: D949373
      879dfa05