1. 19 Mar, 2013 20 commits
    • Tom Jackson's avatar
      Renaming flag in MemoryMapping · d059cdd4
      Tom Jackson authored
      Summary:
      This flag conflicts with the flag with the same purpose in
      `common/files/MemoryMappedFile.cpp`. Just renaming it for now.
      
      Test Plan: Build
      
      Reviewed By: lucian@fb.com
      
      FB internal diff: D717067
      d059cdd4
    • Tom Jackson's avatar
      MemoryMapping · 2b8ea381
      Tom Jackson authored
      Summary: MemoryMapping is a C++ wrapper object around mmap. It works with `folly::File`s, and provides bitwise-range access for reading and writing files.
      
      Test Plan: Unit test
      
      Reviewed By: lucian@fb.com
      
      FB internal diff: D452384
      2b8ea381
    • Lucian Grijincu's avatar
      folly: AsyncIO: add debuging helper · 88b49f3e
      Lucian Grijincu authored
      Summary: Change State to enum class, and add debugging helper to AsyncIOOp and AsyncIO.
      
      Test Plan: n/a
      
      Reviewed By: philipp@fb.com
      
      FB internal diff: D715676
      88b49f3e
    • Tom Jackson's avatar
      folly/{experimental => .}/File · feca2a76
      Tom Jackson authored
      Summary: Moving File into `/folly`.
      
      Test Plan: Same unit tests, rebuild affected code outside folly.
      
      Reviewed By: philipp@fb.com
      
      FB internal diff: D714462
      feca2a76
    • Mike Curtiss's avatar
      Fix SIGSEGV in StringPiece::find_first_of · 4f7a54f6
      Mike Curtiss authored
      Summary:
      Our SSE version of find_first_of was reading past the end of
      the StringPiece in some cases, which (very rarely) caused a seg-fault
      when we were reading outside of our allotted virtual address space.
      
      Modify the code to never read past the end of the underlying buffers
      except when we think it's "safe" because we're still within the same
      page. (ASSUMPTION: if a process is allowed to read a byte within a
      page, then it is allowed to read _all_ bytes within that page.)
      
      Test Plan:
      Added tests that verify we won't go across page boundaries.
      
      Sadly, this code hurts our benchmarks -- sometimes by up to 50% for
      smaller strings.
      
      Reviewed By: philipp@fb.com
      
      FB internal diff: D707923
      
      Blame Revision: D638500
      4f7a54f6
    • Tudor Bosman's avatar
      Rework folly::AsyncIO interface to make it easier for other classes to use Op · a8b4b5ea
      Tudor Bosman authored
      Summary:
      AsyncIOOp no longer requires derivation to be able to use callbacks; the
      callback is passed in.  This makes composition easier (see AsyncIOQueue, added
      in this diff).
      
      Test Plan: async_io_test, test added
      
      Reviewed By: lucian@fb.com
      
      FB internal diff: D709648
      a8b4b5ea
    • Tudor Bosman's avatar
      fix comment · cf583f13
      Tudor Bosman authored
      Test Plan: No
      
      Reviewed By: philipp@fb.com
      
      FB internal diff: D709795
      cf583f13
    • Rajat Goel's avatar
      value_ might be uninitialized · 3cc8d95a
      Rajat Goel authored
      Summary: Compilation is failing in 'opt' build
      
      Test Plan: compile
      
      Reviewed By: andrewjcg@fb.com
      
      FB internal diff: D707869
      3cc8d95a
    • Tudor Bosman's avatar
      Define ALLOCM_LG_ALIGN · 5fabcaa4
      Tudor Bosman authored
      Test Plan: No
      
      Reviewed By: philipp@fb.com
      
      FB internal diff: D707792
      5fabcaa4
    • Gaurav Jain's avatar
      Minor clang compiler fixes · 267e38a8
      Gaurav Jain authored
      Summary: Minor clang compiler fixes
      
      Test Plan: - fbmake runtest
      
      Reviewed By: andrewjcg@fb.com
      
      FB internal diff: D707663
      267e38a8
    • Sergey Doroshenko's avatar
      Make AsyncIO::capacity_ const · bae2dccf
      Sergey Doroshenko authored
      Summary: It is set once, and is never changed afterwards.
      
      Test Plan: compiled, unit tests
      
      Reviewed By: tudorb@fb.com
      
      FB internal diff: D706125
      bae2dccf
    • Jordan DeLong's avatar
      Codemod time\(NULL\) to time(nullptr) · a449e4aa
      Jordan DeLong authored
      Summary: codemod with 'Yes to all'.
      
      Test Plan: None really.
      
      Reviewed By: abirchall@fb.com
      
      FB internal diff: D693769
      a449e4aa
    • Tudor Bosman's avatar
      Fix subtle double-free in trimEnd; optionally pack IOBufQueue after append · 794e35e5
      Tudor Bosman authored
      Test Plan: folly/io/test, both dbg and opt, standalone and in valgrind
      
      Reviewed By: philipp@fb.com
      
      FB internal diff: D702755
      794e35e5
    • Tom Jackson's avatar
      all(), better any() · 0e21224b
      Tom Jackson authored
      Summary: TSIA
      
      Test Plan: Unit tests
      
      Reviewed By: tulloch@fb.com
      
      FB internal diff: D701890
      0e21224b
    • Tudor Bosman's avatar
      fix typos · 04223d27
      Tudor Bosman authored
      Test Plan: async_io_test
      
      Reviewed By: lucian@fb.com
      
      FB internal diff: D699175
      04223d27
    • Peter Griess's avatar
      Add some CursorBase::operator-() implementations · 9547cef8
      Peter Griess authored
      Summary:
      - Add CursorBase::operator-() implementations for Cursor and BufType;
      useful for figuring out the distance between two objects
      
      Test Plan: - Used in some other code
      
      Reviewed By: simpkins@fb.com
      
      FB internal diff: D690046
      9547cef8
    • Philip Pronin's avatar
      assert on self move assignment · 2a80dba7
      Philip Pronin authored
      Test Plan: ran tests in dbg
      
      Reviewed By: tudorb@fb.com
      
      FB internal diff: D696964
      2a80dba7
    • Tudor Bosman's avatar
      AsyncIO: CHECK preconditions · ce80e19d
      Tudor Bosman authored
      Test Plan: async_io_test
      
      Reviewed By: delong.j@fb.com
      
      FB internal diff: D698919
      ce80e19d
    • Tudor Bosman's avatar
      AsyncIO in folly · 8f45b8d5
      Tudor Bosman authored
      Summary:
      Interface extended and cleaned up.  Also, now
      actually allows you to retrieve IO errors.  Also moved some useful functions
      out of Subprocess.cpp into a separate header file.
      
      Test Plan: async_io_test, subprocess_test
      
      Reviewed By: philipp@fb.com
      
      FB internal diff: D698412
      8f45b8d5
    • Andrew Tulloch's avatar
      unsplit · 43300949
      Andrew Tulloch authored
      Summary:
      1. Incorporates @tjackson's offline comments.
      2. See docstrings and examples for basic usage.
      3. The usecase this covers (for me and others) was where I have some map or
      vector of elements, and I want to form a string representation of this (for
      logging, fb303 exported values, etc.). Various uses have existed in fbcode (e.g.
      UP2X shard representations), and this seemed like a useful utility.
      
      Test Plan: unit tests.
      
      Reviewed By: tjackson@fb.com
      
      FB internal diff: D696794
      43300949
  2. 04 Feb, 2013 11 commits
    • Jordan DeLong's avatar
      Update example in folly::gen · b88cb304
      Jordan DeLong authored
      Summary: asVector() doesn't exist.
      
      Test Plan: Nope.
      
      Reviewed By: tjackson@fb.com
      
      FB internal diff: D697240
      b88cb304
    • Tom Jackson's avatar
      contains() · 482a5011
      Tom Jackson authored
      Summary: TSIA
      
      Test Plan: Unit tests
      
      Reviewed By: tulloch@fb.com
      
      FB internal diff: D680177
      482a5011
    • Andrew Gallagher's avatar
      folly/dynamic: fix explicit specializations after instantiation · a0d036e4
      Andrew Gallagher authored
      Summary:
      clang complains that the explicit specializations in dynamic.cpp
      come after references in dynamic-inl.h.
      
      Test Plan:
      - built dyamic.o with clang
      - built folly normally and ran unittests
      
      Reviewed By: delong.j@fb.com
      
      FB internal diff: D691081
      a0d036e4
    • Marcelo Juchem's avatar
      adding some missing remove_reference in make_stl_allocator and is_simple_allocator · e1df3470
      Marcelo Juchem authored
      Summary: adding some missing remove_reference in make_stl_allocator and is_simple_allocator
      
      Test Plan: unit tests
      
      Reviewed By: jon.coens@fb.com
      
      FB internal diff: D689524
      e1df3470
    • Jordan DeLong's avatar
      Remove a bit of debug code in folly::Range · d50ff184
      Jordan DeLong authored
      Summary:
      Seems like we can drop this, as the case that motivated
      adding it wouldn't have been caught by it.
      
      Test Plan: Compiled folly/test.
      
      Reviewed By: tudorb@fb.com
      
      FB internal diff: D684200
      d50ff184
    • Xin Liu's avatar
      fixing rwspinlock test Summary: · a60c8646
      Xin Liu authored
      Summary:
      gcc seems to treat this as declaration:
      
      RWSpinLock::UpgradedHolder ug(
      RWSpinLock::WriteHolder(
      RWSpinLock::ReadHolder(&lock)));
      
      Test Plan: add LOG(INFO) to make sure the holder converstions did get executed.
      
      Reviewed By: marcelo.juchem@fb.com
      
      FB internal diff: D688748
      a60c8646
    • Marcelo Juchem's avatar
      A few fixes for clang support · 378a3bbc
      Marcelo Juchem authored
      Summary: fixes for clang support
      
      Test Plan:
      rm -rf ~/fbcode/_build/* && fbconfig --clang folly/test && fbmake
      rm -rf ~/fbcode/_build/* && fbconfig folly/test && fbmake
      _bin/folly/test/format_test
      _bin/folly/test/optional_test
      _bin/folly/test/has_member_fn_traits_test
      
      Reviewed By: tudorb@fb.com
      
      FB internal diff: D688295
      378a3bbc
    • Philip Pronin's avatar
      qfind_first_byte_of may suffer from global initialization order · 4988b28c
      Philip Pronin authored
      Summary: ##static## handling adds ~2 more ns overhead per call (and the first call is kinda slow), but now the logic is correct now. Also inlined ##qfind_first_byte_of##.
      
      Test Plan: unittests
      
      Reviewed By: tudorb@fb.com
      
      FB internal diff: D687947
      4988b28c
    • Marcelo Juchem's avatar
      Implementing unique/shared_ptr for custom allocators (like Arena) in folly · cc86cd35
      Marcelo Juchem authored
      Summary:
      - moving simple allocator *_ptr and convenience functions to folly
      - getting rid of arena_new - it encourages manually constructing smart pointers when folly::allocate_* should be used instead
      - using std::allocate_shared to construct shared_ptrs, thus properly using the allocator for the ref-counter too
      - fixing forwarding of parameters in the convenience functions
      - uniform allocation of smart pointers using both stl and non stl-like allocators
      
      Test Plan:
      - build + tests of existing client code
      - basic unit tests for arena smart pointers
      
      Reviewed By: delong.j@fb.com
      
      FB internal diff: D672818
      cc86cd35
    • Philip Pronin's avatar
      temporary get rid of ifunc in folly::Range · fe26f5be
      Philip Pronin authored
      Summary:
      See discussion in D638500.
      
      valgrind 3.7 contains a bug that makes it hung up
      (https://bugs.kde.org/show_bug.cgi?id=301204).
      
      glibc 2.5.1 doesn't support ifunc.
      
      In the future we should conditionally compile ifunc stuff (this is also
      required to support clang).
      
      Test Plan:
      unittests, ran range_benchmark to confirm there is no
      significant performance drop, this additional level of indirection adds overhead of ~1ns.
      
      tested on CPUs with and without SSE4.2 support.
      
      Reviewed By: mmcurtiss@fb.com
      
      FB internal diff: D687351
      fe26f5be
    • Jordan DeLong's avatar
      Fix comment in folly::dynamic · 968440a9
      Jordan DeLong authored
      Summary: That's all.
      
      Test Plan: Nope.
      
      Reviewed By: simpkins@fb.com
      
      FB internal diff: D684144
      968440a9
  3. 19 Jan, 2013 9 commits