James Sedgwick [Fri, 26 Sep 2014 15:48:09 +0000 (08:48 -0700)]
fix more flakey tests
Summary: fixed the one brought up in the task, and tweaked another that could theoretically cause problems
Test Plan: ran, though I have not been able to repro the
Reviewed By: njormrod@fb.com
Subscribers: fugalh, njormrod
FB internal diff:
D1575632
Tasks:
5225808
Simon Jenkins [Thu, 25 Sep 2014 21:25:47 +0000 (14:25 -0700)]
Set DEFAULT_CATCHUP_EVERY_N to 10 to get more accurate task expiration when busy event base
Summary:
when event base is busy we're timing out tasks too early.
BIG SCARY NOTE: I don't have the thrift knowledge to know if there's sideeffects of this, please let
me know if this change is harmful.
Test Plan:
tested internally
Reviewed By: davejwatson@fb.com
Subscribers: njormrod
FB internal diff:
D1578466
Tasks:
4752162
Dave Watson [Wed, 24 Sep 2014 18:28:48 +0000 (11:28 -0700)]
Fix SocketAddress AF_UNIX support
Summary: check external_ vs. AF_UNIX. Also fix reset() to reset storage_.addr
Test Plan: fbconfig folly/test:network_address_test; fbmake runtests
Reviewed By: soren@fb.com
Subscribers: tudorb, trunkagent, doug, njormrod
FB internal diff:
D1575098
Andrew Gallagher [Thu, 25 Sep 2014 01:36:16 +0000 (18:36 -0700)]
Add and fix BUCK files for folly
Summary:
This gets almost all of folly building with buck. There are a few
cases we don't support yet (custom test wrappers for spooky test
binaries, dlopen-enabled exception tracer binary, etc), but the
vast majority is covered.
Test Plan: built all build targets and ran all tests buck
Reviewed By: sdwilsh@fb.com
Subscribers: tjackson, sdwilsh, fugalh, njormrod
FB internal diff:
D1577256
Tasks:
5055879
Marc Horowitz [Fri, 5 Sep 2014 23:45:24 +0000 (16:45 -0700)]
expose the class_name in an efficient way
Summary:
Add a class_name method, which doesn't need to throw/catch
regardless how the exception is captured.
Test Plan: exception_wrapper_test
Reviewed By: mshneer@fb.com
Subscribers: njormrod
FB internal diff:
D1543596
Tasks:
5025089
Blame Revision:
Nicholas Ormrod [Thu, 25 Sep 2014 00:02:47 +0000 (17:02 -0700)]
Disable failing wangle test
Summary:
Under moderate load, this part of the test would fail. When
there is resource contention, it is quite possible that the timeout will
be exceeded. A further reduction of the time spread will render this
test next to useless.
Moderate load can be as little as running all of folly's tests at once,
which is something that our testing infrastructure does quite
frequently.
fbconfig -r folly
fbmake runtests
Test Plan:
fbconfig -r folly && fbmake runtests
Reviewed By: hannesr@fb.com
Subscribers: sdwilsh, fugalh, njormrod
FB internal diff:
D1576570
Tasks:
5225808
Soren Lassen [Wed, 24 Sep 2014 20:34:17 +0000 (13:34 -0700)]
Fix some folly memory leaks found with clang:dev + asan
Summary:
Reverts the revert of the small_vector and test parts of
D1569246.
I'm saving the SocketAddress fix for later, because it caused problems
and needs more research.
Test Plan:
unit tests with clang:dev/asan
Reviewed By: njormrod@fb.com
Subscribers: mathieubaudet, philipp, meyering, njormrod
FB internal diff:
D1575574
Blame Revision:
D1575190
Dave Watson [Wed, 24 Sep 2014 17:52:50 +0000 (10:52 -0700)]
update thrift to use managed connection
Summary:
Use the new managed connection code in folly. Cleans things up a fair bit
The only catch was the current ConnectionManager code uses raw pointers, thrift expects shared_ptr so the request object can keep the channel around until the requests are finished
Test Plan: fbconfig -r thrift/lib/cpp2; fbmake runtests
Reviewed By: afrind@fb.com
Subscribers: trunkagent, njormrod, doug, fugalh, alandau, bmatheny, dcsommer, afrind
FB internal diff:
D1519923
Tasks:
5002343
Danny Guo [Wed, 24 Sep 2014 18:48:36 +0000 (11:48 -0700)]
Revert "Fix folly memory leaks found with clang:dev + asan."
Summary: This reverts commit
2c726dcf86bb176fb3695739a3d8bca2f95c41e6.
Test Plan: build it
Reviewed By: soren@fb.com
Subscribers: woo, mathieubaudet, njormrod
FB internal diff:
D1575190
James Sedgwick [Wed, 24 Sep 2014 17:30:21 +0000 (10:30 -0700)]
de-flake tests
Summary: make these more serialized / event based so they don't get flakey under high load
Test Plan:
ran under load - caveat: i was not able to repro the flakiness @njormrod reported
but by inspection these should be fine
Reviewed By: njormrod@fb.com
Subscribers: fugalh, njormrod
FB internal diff:
D1574640
Tasks:
5225808
Soren Lassen [Tue, 23 Sep 2014 19:42:33 +0000 (12:42 -0700)]
Fix folly memory leaks found with clang:dev + asan.
Summary: I tried running folly/test with clang:dev and asan and found these leaks.
Test Plan:
unit tests with clang:dev/asan
Reviewed By: davejwatson@fb.com
Subscribers: davejwatson, trunkagent, mathieubaudet, njormrod, meyering, philipp
FB internal diff:
D1569246
James Sedgwick [Tue, 23 Sep 2014 18:17:03 +0000 (11:17 -0700)]
user-defined expirations
Summary:
Couple of notes:
1. is it a bummer not to have per-task callbacks of some kind? the interfaces set up here only tell you that some task expired, not which one expired. TM calls back with the Runnable object. is that useful?
2. std::chrono::* business is frustratingly verbose, but the safety/explicitness is nice. Not sure how I feel overall.
3. perhaps expirations should be given in microseconds even if we don't think we can accurately accomplish that
Test Plan: added unit
Reviewed By: hans@fb.com
Subscribers: fugalh, njormrod, bmatheny
FB internal diff:
D1563520
Pavlo Kushnir [Tue, 23 Sep 2014 18:10:55 +0000 (11:10 -0700)]
Fix fbthrift build
Summary: Mcrouter open source build is failing because Codel is missing in fbthrift.
Test Plan: visual
Reviewed By: davejwatson@fb.com
Subscribers: fugalh, njormrod
FB internal diff:
D1572122
Blame Revision:
D1566128
Dave Watson [Mon, 22 Sep 2014 22:18:51 +0000 (15:18 -0700)]
fix unittest
Summary: Looks like the test explicitly looks for InvalidAddressFamilyException. I don't think any users are depending on this particular error type either way, I just switched it to InvalidAddressFamilyException
Test Plan:
unit tests
Reviewed By: ldbrandy@fb.com
Subscribers: doug, njormrod
FB internal diff:
D1570363
Tasks:
5153819
James Sedgwick [Tue, 23 Sep 2014 13:12:18 +0000 (06:12 -0700)]
thread safety for Observable::observers_
Summary: this way we can subscribe to an observable and blast data through it simultaneously from different threads
Test Plan: not much... the one client of rx compiles
Reviewed By: davejwatson@fb.com
Subscribers: fugalh, njormrod, bmatheny
FB internal diff:
D1560647
James Sedgwick [Tue, 23 Sep 2014 13:08:00 +0000 (06:08 -0700)]
stats for ThreadPoolExecutor
Summary:
pool-wide stats via a call on the pool, and per-task stats (e.g. to be funneled into a histogram) via an rx subscription
rx needs a little work before this diff is safe - e.g. synchronization around the subscriber list, and perhaps exposing whether there are any subscribers so we can skip stat tracking if no one is listening
won't commit this without moving rx into folly/experimental of course
the idea is that timeout/expiration notifications can also go through the same subscription channel
haven't run the benchmarks yet and have to leave for the evening but tmrw i'll commit changes to the benchmark and get this stuff into windtunnel so i don't have to do so much manual output inspection on future diffs
Test Plan: added unit
Reviewed By: davejwatson@fb.com
Subscribers: fugalh, njormrod, bmatheny
FB internal diff:
D1558424
Tasks:
5002392,
5002425
James Sedgwick [Tue, 23 Sep 2014 12:48:08 +0000 (05:48 -0700)]
move rx to folly/experimental
Summary: As above. I want to use this for the thread pools and it probably belongs in folly long-term anywya (if we stick with it)
Test Plan: compiled the one user
Reviewed By: hans@fb.com
Subscribers: fugalh, mwa, jgehring, fuegen, njormrod
FB internal diff:
D1560578
James Sedgwick [Tue, 23 Sep 2014 12:46:37 +0000 (05:46 -0700)]
move Codel to wangle
Summary: under folly::wangle::
Test Plan: ran unit for experimental/wangle, thrift/lib/cpp/concurrency, and a user of FbThreadManager
Reviewed By: hans@fb.com
Subscribers: trunkagent, fbcode-common-diffs@, fugalh, alandau, bmatheny, everstore-dev@, njormrod
FB internal diff:
D1566128
Nicholas Ormrod [Mon, 22 Sep 2014 21:13:14 +0000 (14:13 -0700)]
Fix lint errors
Summary: Pass const StringPieces by value instead of reference.
Test Plan:
fbconfig -r folly && fbmake runtests
Reviewed By: robbert@fb.com
Subscribers: trunkagent, sdwilsh, njormrod
FB internal diff:
D1569488
Ranjeeth Dasineni [Wed, 20 Aug 2014 19:38:57 +0000 (12:38 -0700)]
rfc : -Wshorten-64-to-32 warnings in folly liger dependencies
Summary:
This is not a fix but me seeking advice here. The context here is that in liger (our common network
stack for mobile platforms), we saw bugs due to truncation and want to enable these warnings. To find those in our code,
I had to first resolve the folly ones. I just got around by making the truncation explicit so that I can get to real errors.
Ideally I would like owners to examine each case and fix the original/accept the explicit truncate if its intended. Let me
know what you think. The last (least preferred) is for us to keep this as a liger only change. We have a couple of ways to
do that but it would be nice to fix.
N.B : this covers only liger dependencies
Test Plan: errors resolved after these changes.
Reviewed By: njormrod@fb.com
Subscribers: trunkagent, doug, shilin, njormrod, seanc, pgriess
FB internal diff:
D1509355
Nathan Bronson [Mon, 22 Sep 2014 18:33:28 +0000 (11:33 -0700)]
fix leak in MPMCQueueTest's use of boost::intrusive_ptr
Summary:
MPMCQueueTest's intrusive reference count test implementation was
incorrect, so it simultaneously didn't test what it should and had a leak.
Test Plan: tests, plus new __thread to track lifetimes
Reviewed By: meyering@fb.com
Subscribers: njormrod, soren, meyering
FB internal diff:
D1569448
Nicholas Ormrod [Mon, 22 Sep 2014 18:27:18 +0000 (11:27 -0700)]
Fix lint errors
Summary: Lines exceeding 80 characters have been restructured.
Test Plan:
fbconfig -r folly && fbmake runtests
Reviewed By: robbert@fb.com
Subscribers: trunkagent, sdwilsh, fugalh, njormrod
FB internal diff:
D1568086
Nicholas Ormrod [Mon, 22 Sep 2014 18:20:47 +0000 (11:20 -0700)]
Increase wangle test timers
Summary:
When running all folly tests at once, as with
fbconfig -r folly && fbmake runtests
the wangle tests sometimes fail. Enough tests are running that the
1-millisecond timer is too small, and is sometimes missed. Bumping
it to 10 milliseconds.
Test Plan:
fbconfig -r folly && fbmake runtests
Reviewed By: hans@fb.com
Subscribers: sdwilsh, fugalh, njormrod
FB internal diff:
D1568124
Tasks:
5180879
Pavlo Kushnir [Sat, 20 Sep 2014 00:02:35 +0000 (17:02 -0700)]
Faster accessors for dynamic values
Summary:
Sometimes it is useful to have a fast accessor to a value stored in dynamic, without any type conversion. These still do the type check, but compiler has more room for optimization.
Test Plan: build folly, will add unit tests/benchmarks if this makes sense at all.
Reviewed By: njormrod@fb.com
Subscribers: jdelong, njormrod
FB internal diff:
D1564867
Guohui Wang [Fri, 29 Aug 2014 01:32:59 +0000 (18:32 -0700)]
add function to push data from another cursor
Summary:
Add a function to Writable to push data from another cursor. Data in the input
cursor could be in a buffer chain.
Added test in IOBufCurosTest.cpp to test the new function.
Test Plan: fbmake runtests;
Reviewed By: simpkins@fb.com
Subscribers: njormrod, net-systems@
FB internal diff:
D1563209
Tasks:
4886058
Blame Revision:
dcsommer [Fri, 19 Sep 2014 22:31:17 +0000 (15:31 -0700)]
Bump version to 9:0
Tudor Bosman [Fri, 19 Sep 2014 19:58:10 +0000 (12:58 -0700)]
Do not barf on invalid ELF files
Summary: The Haskell runtime does magic, and loads an ET_REL file directly.
Test Plan: ran it
Reviewed By: jon.coens@fb.com
Subscribers: njormrod, rkroll
FB internal diff:
D1566853
Tasks:
4401996
@override-unit-failures
Dave Watson [Fri, 12 Sep 2014 18:30:59 +0000 (11:30 -0700)]
move socketaddress to folly
Summary:
Goes with IPAddress and MACAddress already in folly.
* change namespace, add typedef in thrift. Had to update forward decls to folly namespace.
* change exception types to std:: types instead of TTransportException. I fbgs'd for everywhere I could find trying to catch these and updated the type, there looked like there were only ~9 files or so.
Test Plan: contbuild.
@override-unit-failures
Tests already passed in last run
Reviewed By: simpkins@fb.com
Subscribers: doug, ps, alandau, everstore-dev@, njormrod, fugalh, alikhtarov, bmatheny, jsedgwick
FB internal diff:
D1556916
James Sedgwick [Fri, 19 Sep 2014 10:19:17 +0000 (03:19 -0700)]
fix occasional crash in cpu pool
Summary: need to initialize threadsToStop_ and make it signed so it doesn't underflow in rare races
Test Plan: cpu pool unit tests no longer crash if run a ton of times
Reviewed By: davejwatson@fb.com
Subscribers: fugalh, njormrod
FB internal diff:
D1563524
Dave Watson [Thu, 18 Sep 2014 19:12:33 +0000 (12:12 -0700)]
install connectionmanager headers
Summary: Install headers / compile files
Test Plan: watch jenkins build
Reviewed By: dcsommer@fb.com
Subscribers: doug, fugalh, njormrod
FB internal diff:
D1564098
Dave Watson [Thu, 18 Sep 2014 16:45:05 +0000 (09:45 -0700)]
Bump version to 8:0
dungcoi [Thu, 18 Sep 2014 16:19:57 +0000 (09:19 -0700)]
merge https://github.com/facebook/folly/pull/88
Summary:
merge https://github.com/facebook/folly/pull/88, missing install header
Looks like fbthrift build needs this
Test Plan: watch jenkins build still works
Reviewed By: ckwalsh@fb.com
Subscribers: doug, njormrod
FB internal diff:
D1563651
Sean Cannella [Thu, 18 Sep 2014 14:20:04 +0000 (07:20 -0700)]
Remove dependency on std::to_string
Summary:
Mobile platform clang doesn't currently support std::to_string
so remove folly's dependency on it.
Test Plan: existing tests
Reviewed By: mpawlowski@fb.com
Subscribers: kmdent, fma, benyluo, shikong, ranjeeth, subodh, pgriess, njormrod
FB internal diff:
D1562179
Tasks:
5183325
Matt Dordal [Wed, 17 Sep 2014 23:52:03 +0000 (16:52 -0700)]
fix race in Future::waitWithSemaphore
Summary:
There's a race condition in waitWithSemaphore, specifically because we're
returning a new future that's completed by the input future. As a result,
that future may not be completed by the time waitWithSemaphore returns,
although completion should be imminent.
Test Plan:
`var=0; while true ; do echo $((var++)); _bin/folly/wangle/wangle-test --gtest_filter='Future*' || break ; done`
Before change two runs yielded 303 and 371.
After change I killed the test at 11000.
Reviewed By: njormrod@fb.com
Subscribers: fugalh, njormrod
FB internal diff:
D1561281
Tasks:
5180879
Nicholas Ormrod [Wed, 17 Sep 2014 20:21:40 +0000 (13:21 -0700)]
remove eof whitespace lines
Summary:
Remove lint errors from folly: trailing newlines
find folly | xargs arc lint | grep -B3 EOF | grep ">>>" | egrep -o "folly[^:]*" | xargs -n1 sed -i '$d'
folly/experimental/io/test/AsyncIOTest.cpp had two trailing newlines,
the second was removed by hand
@override-unit-failures
Test Plan:
fbconfig -r folly && fbmake runtests
Pretty overkill for a whitespace diff, but why not.
Reviewed By: robbert@fb.com
Subscribers: sdwilsh, fugalh, njormrod
FB internal diff:
D1561213
Dave Watson [Wed, 17 Sep 2014 18:23:54 +0000 (11:23 -0700)]
Bump version to 7:0
Dave Watson [Wed, 17 Sep 2014 17:20:31 +0000 (10:20 -0700)]
move connectionmanager/managed connection to wangle
Summary: Moar code sharing between proxygen/thrift. Code must be moved to a common library: The only one we currently have is folly, but if someone wants to argue for a separate lib, that's cool too
Test Plan: fbconfig -r proxygen; fbmake dev
Reviewed By: dcsommer@fb.com
Subscribers: doug, fugalh, bmatheny, njormrod
FB internal diff:
D1519919
Tasks:
5002343
James Sedgwick [Wed, 17 Sep 2014 09:58:06 +0000 (02:58 -0700)]
ThreadPoolExecutor and its children CPUThreadPoolExecutor and IOThreadPoolExecutor
Summary:
Spun off from https://phabricator.fb.com/
D1534506 as this seemed different enough for a new diff
Similar to previous diff but attempts to reuse a common thread management process between cpu and io bound thread pools. Also sets the stage for other common functionality, e.g. stats, monitoring, timeouts, and so on
Here is some output from the queue benchmark in common/concurrent with both of these pools added (changes to BM not in this diff): https://phabricator.fb.com/P16308560
Test Plan: added a unit test, ran benchmark
Reviewed By: davejwatson@fb.com
Subscribers: fugalh, njormrod, bmatheny
FB internal diff:
D1555443
Tasks:
5002392,
5002425
Sean Cannella [Wed, 17 Sep 2014 00:08:52 +0000 (17:08 -0700)]
Fix folly signed/unsigned comparisons
Summary:
Fix a few sign comparison issues in folly::IPAddress
@override-unit-failures
Test Plan: existing tests, compiled with clang
Reviewed By: meyering@fb.com, davejwatson@fb.com
Subscribers: njormrod, bmatheny, subodh, ranjeeth, pgriess
FB internal diff:
D1559152
Marc Horowitz [Thu, 11 Sep 2014 00:39:19 +0000 (17:39 -0700)]
make with_exception() const work in all cases
Summary:
Abstract the with_exception() logic into a static template
function which will work with a const or non-const object.
Test Plan: exception_wrapper_test
Reviewed By: vloh@fb.com
Subscribers: njormrod
FB internal diff:
D1549175
Tasks:
5127267
Shao-Chuan Wang [Tue, 16 Sep 2014 05:56:18 +0000 (22:56 -0700)]
Adding IO stats in AsyncIO.
Summary:
It would be great if we have IO stats tracking built within AsyncIO.
It would enable upper layer application to better track the number of I/O
that was submitted and completed
Test Plan:
$ fbmake runtests
Test Results Summary:
Passed: 1734
100% successful
Reviewed By: philipp@fb.com
Subscribers: njormrod, schen, stanislav
FB internal diff:
D1557472
Tasks:
5008299
Dave Watson [Mon, 15 Sep 2014 21:30:23 +0000 (14:30 -0700)]
Bump version to 6:0
Chip Turner [Fri, 12 Sep 2014 00:36:50 +0000 (17:36 -0700)]
Add non-strict mode to folly::Singleton
Summary:
It is difficult to guarantee every binary can call
registrationComplete; for now, support a mode where we don't enforce the
strict registration lifecycle. In the fullness of time, we can make
strictness the default.
Test Plan: runtests
Reviewed By: lins@fb.com
Subscribers: lins, anca, njormrod
FB internal diff:
D1551688
Victor Loh [Fri, 12 Sep 2014 22:03:39 +0000 (15:03 -0700)]
equality for exception_wrapper
Summary:
std::exception_ptr expose methods to compare equality and it
will be great to do so for folly::exception_wrapper (it helps in gmock
testing).
Test Plan: added some unit tests to test this new functionality
Reviewed By: mhorowitz@fb.com
Subscribers: njormrod
FB internal diff:
D1546597
Dave Watson [Wed, 3 Sep 2014 21:41:47 +0000 (14:41 -0700)]
Make TSocketAddress use folly::IPAddress
Summary:
Step 1 of moving TAsyncSocket and friends to folly.
folly::IPAddress changes (can split these off if requested):
* isLoopback looks for a single address, as opposed to subnet
* For V6, isPrivate & isLoopback don't seem to check mapped addresses
TSocketAddress changes:
* Make union use folly::IPAddress instead of sockaddr struct. external_ bool to tell if using AF_UNIX instead.
* manage the port and scope/zone info ourselves
@override-unit-failures
Overriding failures, can't get contbuild to finish all builds after several tries. None of the failures look related
Test Plan:
fbconfig -r thrift
fbmake runtests
fbconfig folly/test:network_address_test
fbmake runtests
Reviewed By: simpkins@fb.com
Subscribers: snaptu-diffs@, trunkagent, hphp-diffs@, njormrod, fbcode-common-diffs@, doug, ruibalp, ps, alandau, bmatheny
FB internal diff:
D1479365
Tasks:
3658665
Jim Meyering [Thu, 11 Sep 2014 22:23:17 +0000 (15:23 -0700)]
folly: avoid used-uninitialized bug in a test
Summary:
Clang complained about this.
* folly/gen/test/FileBenchmark.cpp (BENCHMARK): Initialize "rfd" to -1
and verify that it is set to something nonnegative in the first
BENCHMARK_SUSPEND block.
Test Plan:
Run this:
fbconfig -r --clang --with-project-version clang:dev folly/gen && fbmake runtests
and observe that compilation now succeeds. (and test results remain unchanged)
Reviewed By: tudorb@fb.com
Subscribers: njormrod
FB internal diff:
D1551180
Tasks:
4090011
Sara Golemon [Wed, 10 Sep 2014 23:59:58 +0000 (16:59 -0700)]
Bump version to 5:0
Daniel Sommermann [Wed, 10 Sep 2014 23:38:04 +0000 (16:38 -0700)]
Install EvictingCacheMap as part of OSS build
Summary: This may have just been forgotten when imported to folly
Test Plan: live. verified file name
Reviewed By: ranjeeth@fb.com
Subscribers: doug, njormrod
FB internal diff:
D1548804
Sara Golemon [Wed, 10 Sep 2014 18:35:44 +0000 (11:35 -0700)]
Fix folly compilation on MacOSX
Summary:
We don't always have features.h
and our glibc doesn't have __GLIBC_PREREQ()
@override-unit-failures
Test Plan: Builds on MacOSX
Reviewed By: pt@fb.com
Subscribers: njormrod
FB internal diff:
D1546679
Dave Watson [Tue, 9 Sep 2014 18:35:27 +0000 (11:35 -0700)]
Remove broken test
Summary: Broken on other platforms, because demangle(typeid()) seems to return different results? not entirely sure, but would like the builds to be green again
Test Plan: watch contbuild for 'fbthrift jenkins build' to pass
Reviewed By: mhorowitz@fb.com
Subscribers: doug, njormrod
FB internal diff:
D1544919
Blame Revision:
D1535681
Sara Golemon [Tue, 9 Sep 2014 21:22:35 +0000 (14:22 -0700)]
Bump version to 4:0
Dave Watson [Tue, 26 Aug 2014 17:24:34 +0000 (10:24 -0700)]
Move HHWheelTimer to folly
Summary:
Move wheel timer to folly. Needed for abstracting some code out of proxygen/thrift
The only code change was removing usage of thrift's Util::currentTime() in favor of std::chrono::steady_clock::now()
Test Plan: fbconfig thrift/lib/cpp/test:HHWheelTimerTest; fbmake runtests
Reviewed By: alandau@fb.com
Subscribers: doug, alandau, bmatheny, njormrod
FB internal diff:
D1519909
Jason Evans [Wed, 3 Sep 2014 23:08:22 +0000 (16:08 -0700)]
Convert from jemalloc's obsolete *allocm() to *allocx().
Summary:
Convert from jemalloc's obsolete *allocm() to *allocx().
Strengthen goodMallocSize() to always return a jemalloc size class, so
that xallocx() success/failure detection is simple.
@override-unit-failures
Test Plan: Folly, unicorn, and HHVM tests.
Reviewed By: andrei.alexandrescu@fb.com
Subscribers: trunkagent, hphp-diffs@, ps, chaoyc, search-fbcode-diffs@, unicorn-diffs@, ptc, njormrod
FB internal diff:
D1535841
Tasks:
4996808
Marc Horowitz [Thu, 4 Sep 2014 02:32:36 +0000 (19:32 -0700)]
fix exceptionStr to work for derived classes of std::exception
Summary:
templates and overloads are hard. This uses SFINAE to get
the desired behavior, and includes a test.
This also removes a hack in ExceptionWrapper which isn't needed with this fix.
Test Plan: string_test, exception_wrapper_test
Reviewed By: andrei.alexandrescu@fb.com
Subscribers: dreiss, dancol, njormrod
FB internal diff:
D1535681
Blame Revision:
D1517701
Pavlo Kushnir [Mon, 8 Sep 2014 17:32:04 +0000 (10:32 -0700)]
Fix bug in stripComments
Summary: the bug is in InString state when we escape only '"' character. We should escape at least '\\' and '"'. This diffs simply escapes any character after '\\'.
Test Plan: folly unit tests, mcrouter unit tests
Reviewed By: stepan@fb.com
Subscribers: njormrod
FB internal diff:
D1540836
Chip Turner [Wed, 3 Sep 2014 19:22:45 +0000 (12:22 -0700)]
Fix bug in circular singleton creation detection
Summary:
We considered it circular if we tried to create a singleton
while the singleton was being created. In a single threaded world, this
is correct, but under concurrency, two threads can be in the singleton
creation codepath and become confused about the state of the singleton.
This change uses a condition variable to notify when creation completes
so that other threads can wait on the creation to complete. Circular
creation is detected via thread id.
Test Plan:
runtests (new test case; failed without the fix, passes with
it)
Reviewed By: hans@fb.com
Subscribers: lins, anca, njormrod, rkroll
FB internal diff:
D1534081
Hannes Roth [Thu, 4 Sep 2014 16:17:56 +0000 (09:17 -0700)]
(Folly/Wangle) Later.then, Later.whenAllLater
Summary:
Adding some basic functionality to `Later` to make it easier to chain
things.
Test Plan:
Added tests.
`fbconfig -r folly/wangle && fbmake runtests_{dbg,dbgo,opt}`
`fbconfig --clang -r folly/wangle && fbmake runtests_{dbg,dbgo,opt}`
Reviewed By: hans@fb.com
Subscribers: fugalh, njormrod
FB internal diff:
D1527826
Tasks:
4993420
Matt Dordal [Wed, 3 Sep 2014 23:47:14 +0000 (16:47 -0700)]
Rename shadowing local variables in various stats objects
Summary:
The GCC shadow variable detector is quite zealous in warning about
shadowed members. Here, we have local variables that share the name
of member functions. Rename them so that -Wshadow doesn't complain.
Test Plan:
It didn't build, and now it does.
`fbconfig -r folly && fbmake runtests`
Reviewed By: njormrod@fb.com
Subscribers: fbcode-common-diffs@, njormrod
FB internal diff:
D1534033
Chip Turner [Wed, 30 Jul 2014 22:38:28 +0000 (15:38 -0700)]
Make using folly::Singleton easier: names and direct referencing
Summary:
There are times when you want multiple singletons of the same
underlying type -- for instance, a fast and slow request handling
singleton. This diff allows for that with an optional name that
disambiguates multiple singletons of the same type.
In addition, we now also allow direct dereferencing of the
Singleton<Foo> object to get to the underlying singleton. This is most
useful in cases where a singleton is used inside of the same cpp file it
is defined.
Finally, make get() faster by caching the underlying pointer rather than
accessing the shared pointer. If you're using it, you already have a
race condition and hopefully your singleton lifecycle is sane and safe
from problems this may cause.
Test Plan: runtests
Reviewed By: hans@fb.com
Subscribers: njormrod, lins, anca
FB internal diff:
D1485887
Philip Pronin [Thu, 28 Aug 2014 11:05:45 +0000 (04:05 -0700)]
use folly::Baton in waitWithSemaphore
Test Plan:
fbconfig -r folly/wangle && fbmake runtests -j32
Reviewed By: lucian@fb.com
Subscribers: sdoroshenko, fugalh, njormrod
FB internal diff:
D1525044
Tasks:
2680246
Blame Revision:
D1358230
Marc Horowitz [Mon, 11 Aug 2014 22:40:23 +0000 (15:40 -0700)]
Make it work more generically
Summary:
Change the strategy here: provide a more generic interface
which can be used safely with any exception types, but operates more
efficiently for explicitly named types. Update the callers to use the
new pattern, which mostly means get() and operator* are replaced with
other more generic methods. (This diff was constructed by merging
D1490304,
D1501644, and
D1500861.)
Test Plan:
run tests. Run something which generates an exception
message, and make sure that message isn't "std::exception"
Reviewed By: marccelani@fb.com
Subscribers: ruibalp, mcduff, marccelani, hitesh, mshneer, rtgw-diffs@, alandau, bmatheny, adityab, wormhole-diffs@, bwester, njormrod
FB internal diff:
D1517701
Chip Turner [Thu, 7 Aug 2014 13:19:22 +0000 (06:19 -0700)]
Improve messaging when registrationComplete hasn't been called
Summary:
The previous message from CHECK_THROW was difficult to debug.
This improves the messaging to be more actionable.
Test Plan: runtests
Reviewed By: lins@fb.com
Subscribers: lins, anca, fugalh
FB internal diff:
D1483915
Soren Lassen [Sun, 24 Aug 2014 05:27:12 +0000 (22:27 -0700)]
EventCountTest cleanups
Summary: based on code review feedback in
D1516171
Test Plan: ran the test
Reviewed By: philipp@fb.com
Subscribers: njormrod
FB internal diff:
D1516187
Daniel Sommermann [Fri, 22 Aug 2014 20:26:52 +0000 (13:26 -0700)]
Fix compilation warning
Summary:
Defining hash as a struct and a class was causing some junk to
get printed during fbmake.
Test Plan: `fbconfig -r proxygen; fbmake dbg`, ran unit tests, didn't see output
Reviewed By: njormrod@fb.com
Subscribers: doug, shilin, njormrod
FB internal diff:
D1514793
Nicholas Ormrod [Fri, 22 Aug 2014 17:07:25 +0000 (10:07 -0700)]
Fix block overhead estimation in tests
Summary:
folly/test/ArenaTest.h assumes that goodMallocSize will account
for the block overhead, if the size is +1. However, when compiling
without jemalloc (as, I would imagine, most of our open-source clients
do), goodMallocSize(64 + 1) returns 65, which is less than 64 +
sizeof(Block), and so the tests fail.
I have added a constant to Arena.h which exposes the overhead taken by
the Block, and changed the tests to use that value instead of 1.
(Arena::getTotalSize relies on the totalAllocatedSize_ variable, which
is only non-trivially set in allocateSlow, where the size of the heap is
added to sizeof(Block)).
Test Plan: fbconfig --allocator=malloc folly/test:arena_test && fbmake runtests
Reviewed By: jon.coens@fb.com
Subscribers: sdwilsh, njormrod
FB internal diff:
D1512231
Sean Cannella [Thu, 21 Aug 2014 21:26:49 +0000 (14:26 -0700)]
Fix various compiler warnings
Summary:
This allows projects that use -Wextra (sans -Wunused-parameter) to
compile folly.
Test Plan: compiled with gcc and clang
Reviewed By: meyering@fb.com
Subscribers: njormrod, kmdent, fma, benyluo, shikong, ranjeeth, subodh, pgriess
FB internal diff:
D1509827
Nicholas Ormrod [Thu, 21 Aug 2014 19:44:48 +0000 (12:44 -0700)]
Fix #includes
Summary:
A few of folly's includes do not start with folly/, and so were
missed by
D1411225's include-quotation ##""## -> ##<>## transformation change.
There were also some folly includes in deeper folly directories and the
docs, which I also fixed.
The search ##egrep "# *include *\"" -R folly/*## now only includes two
lines in FBString.h, which are included for libgcc purposes.
The wangle/test/Thens.cpp file, which is auto-generated, was special.
I changed the generator .rb script, but when I ran it I overwrote some
manual changes to Thens.cpp. For simplicity, I have manually applied the
change to Thens.cpp as well.
Test Plan: fbconfig -r folly && fbmake runtests
Reviewed By: hannesr@fb.com
Subscribers: sdwilsh, fugalh
FB internal diff:
D1511712
Jim Meyering [Sun, 17 Aug 2014 21:34:32 +0000 (14:34 -0700)]
fbcode: __x__-protect all __attribute__ keywords, mechanically
Summary:
The first (and sometimes 2nd) argument to __attribute__
should begin and end with "__". If it does not, then it
is at risk of conflicting with user cpp-defined symbols.
Don't do that. This change mechanically corrects most
such violations in fbcode. A companion change (see parent task)
adds a lint rule to help keep things clean going forwards.
Define this function to filter the list of file names to which
we will apply the transformations. First, ensure we modify only
C and C++ sources. The second process excludes a few directories
that appear to contain third-party code:
filter() {
grep -E '\.(c|h|cc|cpp|hpp)$' | grep -vE \
'^external/|/unbound/|/gearmand_|(3rd|third.)party|/external/libevent'
}
then, run this command,
git grep -l __attribute__ | filter \
| xargs perl -pi -e 's/(__attribute__ *)\(\(( *[^_]\w+)/$1((__${2}__/g'
inducing changes like this, for each such keyword:
-} __attribute__((packed));
+} __attribute__((__packed__));
That got all but the __format__ archetype arguments like this:
__attribute__((__format__(printf. That final "printf"
keyword should have the "__" prefix and suffix, too.
Run this command to transform those remaining uses:
git grep -l '__attribute__.*__format' | filter | xargs perl -pi -e \
's/(__attribute__ *\(\(__format__ *)\( *(printf|scanf|strftime|strfmon)/$1(__${2}__/g'
That command induces changes like this:
-static inline int __attribute__ ((__format__ (printf, 3, 4)))
+static inline int __attribute__ ((__format__ (__printf__, 3, 4)))
This exercise is useful to avoid spurious name-space conflicts,
especially when the unprotected keyword is used in a header file.
Test Plan:
I've ensured tao builds and passes its tests.
I will watch the arc-run tests.
Reviewed By: njormrod@fb.com
Subscribers: rounak, trunkagent, hphp-diffs@, nli, ps, fbcode-common-diffs@, mcdonald, chaoyc, bill, search-fbcode-diffs@, lars, net-systems@, davejwatson, varunk, ruibalp, hero-diffs@, andrewcox, sorg, dfechete, dhruba, sdoroshenko, mcduff, marccelani, hitesh, mshneer, cold-storage-diffs@, omry, jcoens, unicorn-diffs@, ldbrandy, sumeet, abirchall, fugalh, atlas2-eng@, dcapra, mpawlowski, alandau, nkgupta, shilin, bmatheny, everstore-dev@, zhuohuang, wormhole-diffs@, vnalla, msk, maoy, mwa, jgehring, adsatlasreporting@, mconnor, oujin, bwester, micha, tulloch, ptc, logdevice-diffs, alikhtarov, shikong, fuegen
FB internal diff:
D1508983
Tasks:
4947824
@override-unit-failures
Dave Watson [Fri, 8 Aug 2014 18:28:15 +0000 (11:28 -0700)]
Add link-local scope handling
Summary: Also save the link-local scope in the V6 address. See
D1479365 for more details
Test Plan: fbconfig folly/test:network_address_test; fbmake runtests
Reviewed By: simpkins@fb.com
Subscribers: marccelani, doug, ps, bmatheny
FB internal diff:
D1486435
Marcin Pawlowski [Wed, 20 Aug 2014 05:25:05 +0000 (22:25 -0700)]
made toAppendDelim better
Summary:
preallocate once and for all, so that we
are really malloc efficient in toAppendDelim
Test Plan: unit tests
Reviewed By: marcelo.juchem@fb.com
FB internal diff:
D1496310
Tasks:
4886092
Nicholas Ormrod [Wed, 20 Aug 2014 01:23:44 +0000 (18:23 -0700)]
Fix Optional test for -fb platform
Summary:
The Optional test relied on std::string clearing its data when
it is the source of a move. This does not happen for in-situ fbstrings,
so the test breaks in the -fb platform. The solution: wrap the string in
a class that explicitly invalidates its data upon a move.
Test Plan:
fbconfig --platform-all=gcc-4.8.1-glibc-2.17-fb -r folly
fbmake runtests
fbconfig -r folly
fbmake runtests
Reviewed By: tudorb@fb.com
Subscribers: sdwilsh
FB internal diff:
D1506840
Tasks:
4943996
Tom Jackson [Thu, 14 Aug 2014 05:17:05 +0000 (22:17 -0700)]
hash_range
Test Plan: Unit test
Reviewed By: andrei.alexandrescu@fb.com
Subscribers: shilin
FB internal diff:
D1497250
Hannes Roth [Tue, 19 Aug 2014 22:26:47 +0000 (15:26 -0700)]
(Wangle) Optimize empty continuation
Summary: It should remove one malloc as per the task.
Test Plan: `fbconfig folly/wangle && fbmake runtests` Also, `--clang`.
Reviewed By: davejwatson@fb.com
Subscribers: fugalh
FB internal diff:
D1498331
Tasks:
4913277
Tudor Bosman [Sat, 16 Aug 2014 22:09:20 +0000 (15:09 -0700)]
Add Optional::value_or
Summary:
Common pattern: a function returns Optional<X>, indicating whether some X was
present or not; you want a default value if the X was not present. Requires
that X is copiable.
Test Plan: optional_test (test added)
Reviewed By: tjackson@fb.com
Subscribers: aalexandre, fjargsto, jhj, ntv, lesha, kma
FB internal diff:
D1502397
Jez Ng [Tue, 19 Aug 2014 00:33:23 +0000 (17:33 -0700)]
Fix json_test's lookup of test files.
Summary:
The test runner for folly seems to run from folly/test rather than the base fbcode directory. This hack ensures that we find the necessary test files in either case.
This fixes the breakage introduced by {
D1493963}.
Test Plan: fbconfig -r folly && fbmake runtests
Reviewed By: davejwatson@fb.com
Subscribers: dipanshu
FB internal diff:
D1502161
Andrey Kashin [Mon, 18 Aug 2014 19:08:19 +0000 (12:08 -0700)]
Enabling folly::Synchronized for non-default constructible objects
Summary:
Currently folly::Synchronized can't be used with non-default
constructible types because copy and move constructors require
creation of datum_ before it's assignment.
To fix this we can initialize them in initializer-list and
handle guard creation using helper constructor
Test Plan:
fbconfig -r folly && fbmake runtests
Fixes compilation error: Synchronized started working for non-default
constructible types in my project(rfe).
Reviewed By: yuri@fb.com
Subscribers: dhruvbird
FB internal diff:
D1502110
Darren Mo [Sun, 17 Aug 2014 00:32:54 +0000 (17:32 -0700)]
Clang Love
Summary: Added support for clang in Checksum.cpp preprocessor statements.
Test Plan: The right code path is chosen using both gcc and clang now.
Reviewed By: brianp@fb.com
Subscribers: mathieubaudet, sroy, satadru
FB internal diff:
D1502289
Jez Ng [Fri, 15 Aug 2014 17:29:26 +0000 (10:29 -0700)]
Factor out JSON stripComments().
Summary:
Comments are a useful extension to JSON, especially for configuration files.
Facebook: twagent would previously barf on JSON files that contained '//' in their strings, and this commit allows twagent to strip comments properly. Fixes T4686066.
Test Plan: fbconfig common/json mcrouter/lib/config tupperware/agent && fbmake runtests
Reviewed By: aravindn@fb.com
Subscribers: anarayanan, pavlo, stepan, dipanshu, alikhtarov
FB internal diff:
D1493963
Tasks:
4686066
Sara Golemon [Fri, 15 Aug 2014 05:38:03 +0000 (22:38 -0700)]
Bump version to 3:2
Sara Golemon [Fri, 15 Aug 2014 05:30:58 +0000 (22:30 -0700)]
don't use readFromSysfs on non-linux
Summary:
It eventually tries to read from /sys/devices which is not portable.
Let's just fall back to sysconf/CacheLocality::uniform.
This fixes a runtime crash on OSX, but CYGWIN/BSD were probably also
affected.
Closes #80
@override-unit-failures
Test Plan: author tested, contbuild, flib
Reviewed By: joelm@fb.com
FB internal diff:
D1498567
Sara Golemon [Fri, 15 Aug 2014 04:53:49 +0000 (21:53 -0700)]
Add missing s6_addr16 define for MacOSX targets
Summary:
This is a known issue on Darwin
@override-unit-failures
Test Plan: folly/detail/IPAddress.h compiles on a mac
Reviewed By: joelm@fb.com
FB internal diff:
D1499795
Sara Golemon [Fri, 15 Aug 2014 02:19:11 +0000 (19:19 -0700)]
Bump version to 3:1
Daniel Sloof [Thu, 14 Aug 2014 21:12:19 +0000 (14:12 -0700)]
be explicit about what integer type we're using
Summary:
Fixes the OSX build.
Closes #79
Test Plan: author tested, contbuild, flib
Reviewed By: joelm@fb.com
FB internal diff:
D1498545
Sara Golemon [Thu, 14 Aug 2014 18:49:22 +0000 (11:49 -0700)]
Bump version to 3:0
Hannes Roth [Thu, 14 Aug 2014 15:52:49 +0000 (08:52 -0700)]
(Wangle) Generic void star callback wrapper
Summary: Less generic than I hoped for. Naming is terrible.
Test Plan:
`fbconfig -r tao/client && fbmake runtests` -- I figured if it compiles
it works. Also did a `--sanitize=address` build just in case.
Reviewed By: hans@fb.com
Subscribers: fugalh, zhuohuang, anca
FB internal diff:
D1470483
Philip Pronin [Thu, 14 Aug 2014 07:07:59 +0000 (00:07 -0700)]
fix build (gtest 1.6 -> 1.7)
Summary:
D1494614 migrated us to gtest 1.7 which broke multiple builds (with
"error: 'tuple' is already declared in this scope" coming from
https://code.google.com/p/googletest/source/detail?spec=svn621&r=621).
This diff makes folly compatible with both versions of gtest, and the rest
of fbcode is now compatible with gtest 1.7.
Test Plan: fbconfig -r folly unicorn/diskindex4 && fbmake opt -j32
Reviewed By: jiayan@fb.com
Subscribers: fbcode-common-diffs@, chaoyc, search-fbcode-diffs@, sdoroshenko, cold-storage-diffs@, unicorn-diffs@
FB internal diff:
D1497389
Tasks:
4909974,
4910547,
4910567,
4909983
Ranjeeth Dasineni [Thu, 7 Aug 2014 07:34:11 +0000 (00:34 -0700)]
move EvictingCacheMap to folly
Summary:
adding @agartrell's implementation of EvictingCacheMap to folly. Its a general purpose
cache with LRU eviction. It maintains a doubly linked list threaded throught a hash map using
boost::intrusive. set, get and delete are all constant time operations. It is not thread safe.
Configurability: It allows callers to specify a hasher for the keys, has callbacks for eviction
events and the number of evictions on reaching a capacity limit is configurable. resizing for
a higher capacity though could be suboptimal since index is not resized accordingly and you could
end up with a bad load factor.
Test Plan: unit tests
Reviewed By: tulloch@fb.com, njormrod@fb.com
Subscribers: tulloch, chrisbray, mhx, doug, agartrell
FB internal diff:
D1483789
Josh Watzman [Wed, 13 Aug 2014 22:05:12 +0000 (15:05 -0700)]
Remove constructor version attribute on OS X
Summary:
OS X doesn't support this -- it requires support at the linker
level which OS X just doesn't have. Reasonable OS X compilers will yell
about it, but even the ones that don't are just silently dropping it
on the floor.
So I'm not sure what //we// can do other than just silently dropping
this on the floor too and hoping that everything works.
Test Plan:
HHVM build on OS X gets ever so slightly further (runs into
other issues). HHVM build in fbcode still seems to build folly okay
(didn't wait for it to finish fully).
Fixes https://github.com/facebook/folly/issues/78
Reviewed By: tudorb@fb.com
FB internal diff:
D1487191
Blame Revision: rFBCODE502be7cb0fda306ddc33b9c5ad7a53b0cfbdc893
Brian Pane [Wed, 13 Aug 2014 06:00:02 +0000 (23:00 -0700)]
Small memory footprint reduction for folly::MultiLevelTimeSeries
Summary:
* Spend some extra time in getNumBuckets() in order to save
space: 8 bytes per object on 64-bit platforms.
Test Plan: Ran the unit tests
Reviewed By: simpkins@fb.com
Subscribers: ruibalp
FB internal diff:
D1488345
Lucian Grijincu [Tue, 12 Aug 2014 01:14:21 +0000 (18:14 -0700)]
folly: operator << for MutableStringPiece
Test Plan: n.a
Reviewed By: philipp@fb.com
FB internal diff:
D1487919
Nathan Bronson [Thu, 31 Jul 2014 06:08:17 +0000 (23:08 -0700)]
always log from LOG_EVERY_MS if interval is <= 0
Summary:
This diff changes LOG_EVERY_MS so that if the specified
interval is zero or negative, no clock call is made and LOG(severity) is
always called. milli_interval is copied into a temporary to avoid
double-evaluation.
Test Plan:
1. unit tests
2. new unit test
Reviewed By: lesha@fb.com
FB internal diff:
D1469366
Tasks:
4813858
Chip Turner [Fri, 8 Aug 2014 10:41:20 +0000 (03:41 -0700)]
Fix test breakage in clang
Summary:
clang would re-use the same memory location for recreated
objects, so instead of checking pointers, we can use a serial number.
Test Plan: runtests with fbconfig --clang
Reviewed By: lins@fb.com
Subscribers: mathieubaudet, lins, anca
FB internal diff:
D1485907
Marc Celani [Thu, 7 Aug 2014 20:24:05 +0000 (13:24 -0700)]
store ipaddresses in folly::IPAddress
Summary: Save space and avoid extra mallocs
Test Plan: fbconfig -r smc/zeus; fbmake runtests
Reviewed By: henryf@fb.com
Subscribers: zeus-diffs@
FB internal diff:
D1476688
Tasks:
4832974
Sarang Masti [Thu, 31 Jul 2014 00:45:16 +0000 (17:45 -0700)]
Add timed_wait and try_wait to Baton
Summary:
This diff adds timed_wait that allows waiting on the Baton
with a timeout. The diff also adds try_wait which doesn't
block the thread at all.
Test Plan:
-- added new unit tests
-- ran all folly tests
Reviewed By: ngbronson@fb.com
Subscribers: bwatling
FB internal diff:
D1468909
Tasks:
4679428
Philip Pronin [Sat, 2 Aug 2014 08:48:46 +0000 (01:48 -0700)]
EliasFanoReader::{jump,jumpTo}
Summary:
Renamed `goTo` to `jump`, introduced `jumpTo`.
FBCode: Updated CSS tree benchmark to compare with EF-based search that
is using `jumpTo` (P14517259).
Test Plan: fbconfig -r folly/experimental/test:eliasfano_test && fbmake runtests_opt -j32
@override-unit-failures
Reviewed By: lucian@fb.com
Subscribers: fbcode-common-diffs@
FB internal diff:
D1474431
Tasks:
4536072
Henry Filgueiras [Wed, 6 Aug 2014 18:39:55 +0000 (11:39 -0700)]
Improve IPAddress::toFullyQualified() CPU performance
Summary:
Currently IPAddress::toFullyQualified() is fairly slow for IPv6.
Change here implements more lightweight in_addr/in6_addr to string functions.
I also added a benchmark for comparison with inet_ntop.
This makes IPAddressV6::toFullyQualified() significantly faster than inet_ntop, and makes IPAddressV4::str() ~20ns faster than previous impementation (previously ~80ns).
Previous benchmark:
============================================================================
folly/test/IPAddressBenchmark.cpp relative time/iter iters/s
============================================================================
ipv4_to_string_inet_ntop 238.91ns 4.19M
ipv4_to_fully_qualified 289.96% 82.39ns 12.14M
----------------------------------------------------------------------------
ipv6_to_string_inet_ntop 780.72ns 1.28M
ipv6_to_fully_qualified 51.11% 1.53us 654.59K
============================================================================
With this change:
============================================================================
folly/test/IPAddressBenchmark.cpp relative time/iter iters/s
============================================================================
ipv4_to_string_inet_ntop 238.06ns 4.20M
ipv4_to_fully_qualified 364.76% 65.26ns 15.32M
----------------------------------------------------------------------------
ipv6_to_string_inet_ntop 770.74ns 1.30M
ipv6_to_fully_qualified 791.63% 97.36ns 10.27M
============================================================================
Test Plan:
fbconfig folly/test:network_address_test folly/test:network_address_benchmark
fbmake runtests_opt
Reviewed By: simpkins@fb.com
Subscribers: ps, bmatheny
FB internal diff:
D1477925
Tasks:
4832974
Jim Meyering [Tue, 5 Aug 2014 20:16:15 +0000 (13:16 -0700)]
folly/test: correct an erroneous test for failed mmap
Summary:
* folly/test/AtomicHashArrayTest.cpp (MmapAllocator):
Upon failure, mmap returns MAP_FAILED, not NULL.
Test Plan:
fbconfig -r folly/test:atomic_hash_array_test && fbmake runtests
Reviewed By: mwang@fb.com
FB internal diff:
D1481080
Tasks:
4846893
Philip Pronin [Sun, 3 Aug 2014 00:33:03 +0000 (17:33 -0700)]
streaming support for EF compression
Test Plan: fbconfig -r folly/experimental/test:eliasfano_test && fbmake opt -j32
Reviewed By: lucian@fb.com
Subscribers: chaoyc, search-fbcode-diffs@, unicorn-diffs@
FB internal diff:
D1474625
Tasks:
4828866
Jim Meyering [Tue, 5 Aug 2014 18:45:25 +0000 (11:45 -0700)]
folly/IndexedMemPool: correct an erroneous test for failed mmap
Summary:
* folly/IndexedMemPool.h (IndexedMemPool): Correct the test for
failed mmap. Upon failure, it returns MAP_FAILED, not nullptr.
Test Plan:
fbconfig -r folly/test:indexed_mem_pool_test && fbmake runtests
Reviewed By: ngbronson@fb.com
FB internal diff:
D1480389
Tasks:
4846893
@override-unit-failures
Marc Celani [Tue, 5 Aug 2014 13:04:24 +0000 (06:04 -0700)]
sorted_vector containers have a shrink_to_fit() method
Summary: Adds a shrink_to_fit() method to sorted vector types.
Test Plan: unit test
Reviewed By: mshneer@fb.com
FB internal diff:
D1477864