- 19 Mar, 2013 31 commits
-
-
Ben Gertzfield authored
Summary: When compiling folly with clang, the compiler warns about our use of GCC-specific pragmas to silence incorrect compiler warnings: folly/Optional.h:79:33: warning: unknown warning group '-Wpragmas', ignored [-Wunknown-pragmas] folly/Optional.h:80:33: warning: unknown warning group '-Wmaybe-uninitialized', ignored [-Wunknown-pragmas] Thankfully, those incorrect compiler warnings are not emitted by clang, so we can just disable the pragmas in clang. Test Plan: Built folly in gcc and ran it through clang. Warning above is gone. Reviewed By: andrei.alexandrescu@fb.com FB internal diff: D733323
-
Tudor Bosman authored
Test Plan: async_io_test Reviewed By: philipp@fb.com FB internal diff: D730100
-
Tom Jackson authored
Summary: In hopes of keeping 'busywork' helpers out of folly, I've moved this closer to the code that needed to do this. Test Plan: Unit tests Reviewed By: andrei.alexandrescu@fb.com FB internal diff: D729194 Blame Revision: D726916
-
Tom Jackson authored
Summary: Now that we have truthy files, it would be nice to be able to simply //try// opening files and return a possibly-initialized File. Test Plan: Unit tests Reviewed By: chaoyc@fb.com FB internal diff: D726916
-
Tom Jackson authored
Summary: File has a default constructor so it can be initialized late, but it doesn't have a good canonical way to see if it's been initialized. This adds an //explicit// operator bool so you can test files like `if (file) ...`. Test Plan: Unit tests Reviewed By: chaoyc@fb.com FB internal diff: D726914
-
Tudor Bosman authored
Summary: Added Adaptor(size_t, const value_type&) Test Plan: test added Reviewed By: soren@fb.com FB internal diff: D726358
-
Tom Jackson authored
Summary: 'open() failed' isn't too helpful. Seeing a filename there is. So I added it. Test Plan: Unit test Reviewed By: mohittalwar@fb.com FB internal diff: D725204
-
Adam Simpkins authored
Summary: Add a --bm_min_iters flag to control the minimum number of iterations that the benchmark code starts with on each epoch. This can be used on benchmarks that test very cheap operations, but take a long time to set up. Otherwise the benchmark code may have to retry many times before it hits a large enough number of iterations to get a meaningful result, and each time it still pays the fixed setup cost. This also helps with benchmarks when some of the setup cost cannot be hidden with BenchmarkSuspender for some reason. --bm_min_iters can be set to a large enough value so that the extra startup cost will not affect the measurements too much. Test Plan: Used this with the thread local stats benchmark. During setup/cleanup, this benchmark starts and synchronizes with many threads. The entire setup time cannot be reliably hidden with BenchmarkSuspender; the synchronization between the threads takes a relatively long time compared to the cost of the operation being benchmarked. --bm_min_iters allows a relatively high number of iterations to be used, masking this cost. Reviewed By: rajat@fb.com FB internal diff: D723304
-
Mike Curtiss authored
Summary: Helper method for creating a folly::Optional<T> by just passing in a T reference. Analogous to boost::make_optional. Test Plan: Added test case Reviewed By: tjackson@fb.com FB internal diff: D721762
-
Lucian Grijincu authored
Summary: MemoryMapping::data() returns StringPiece ::range() returns ByteRange Test Plan: tests Reviewed By: philipp@fb.com FB internal diff: D720985
-
Owen Yamauchi authored
Summary: There are platforms other than clang that don't support ifuncs. (The one I'm concerned about is ARM.) I changed the ifdef __clang__ around the ifunc attributes to be more abstract, so we can can pass in this flag on the command line, or use autoconf to detect it. Test Plan: fbmake runtests. Manually define HAVE_IFUNC 0 and make sure the popcount() and popcountll() functions get compiled as calls to popcount_builtin. Run autoreconf, ./configure, make sure the feature gets detected properly by looking at config.h. Reviewed By: andrewjcg@fb.com FB internal diff: D712192
-
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
-
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
-
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
-
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
-
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
-
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
-
Tudor Bosman authored
Test Plan: No Reviewed By: philipp@fb.com FB internal diff: D709795
-
Rajat Goel authored
Summary: Compilation is failing in 'opt' build Test Plan: compile Reviewed By: andrewjcg@fb.com FB internal diff: D707869
-
Tudor Bosman authored
Test Plan: No Reviewed By: philipp@fb.com FB internal diff: D707792
-
Gaurav Jain authored
Summary: Minor clang compiler fixes Test Plan: - fbmake runtest Reviewed By: andrewjcg@fb.com FB internal diff: D707663
-
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
-
Jordan DeLong authored
Summary: codemod with 'Yes to all'. Test Plan: None really. Reviewed By: abirchall@fb.com FB internal diff: D693769
-
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
-
Tom Jackson authored
Summary: TSIA Test Plan: Unit tests Reviewed By: tulloch@fb.com FB internal diff: D701890
-
Tudor Bosman authored
Test Plan: async_io_test Reviewed By: lucian@fb.com FB internal diff: D699175
-
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
-
Philip Pronin authored
Test Plan: ran tests in dbg Reviewed By: tudorb@fb.com FB internal diff: D696964
-
Tudor Bosman authored
Test Plan: async_io_test Reviewed By: delong.j@fb.com FB internal diff: D698919
-
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
-
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
-
- 04 Feb, 2013 9 commits
-
-
Jordan DeLong authored
Summary: asVector() doesn't exist. Test Plan: Nope. Reviewed By: tjackson@fb.com FB internal diff: D697240
-
Tom Jackson authored
Summary: TSIA Test Plan: Unit tests Reviewed By: tulloch@fb.com FB internal diff: D680177
-
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
-
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
-
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
-
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
-
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
-
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
-
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
-