lp:folly
- Get this branch:
- bzr branch lp:folly
Branch merges
Branch information
Import details
This branch is an import of the HEAD branch of the Git repository at git://github.com/facebook/folly.git.
Last successful import was 3 hours ago.
Recent revisions
- 9374. By Yedidya Feldblum <email address hidden> 17 hours ago
-
move ready_awaitable, variant_awaitable to coroutine header
Summary:
Move `ready_awaitable`, `variant_awaitable` types to `folly/experimental/ coro/Coroutine. h`, which reexports the foundational vocabulary coroutine helper types and is a suitable place for these vocabulary coroutine helper types. `ready_awaitable` is an awaitable which is ready and has a value or, if of void, which is just ready. `variant_awaitable` is an awaitable composed of one of several possible backing awaitables.
Reviewed By: aary
Differential Revision: D26270528
fbshipit-source-id: e98f64b3d3ffaf5
bbd322397a41bb5 fe85a6bb55 - 9373. By Victor Zverovich <email address hidden> on 2021-02-27
-
Deprecate folly::format
Summary:
`folly::format` is a problematic API because it returns a `Formatter` object that may store references to arguments as its comment warns:```
* Formatter class.
*
* Note that this class is tricky, as it keeps *references* to its lvalue
* arguments (while it takes ownership of the temporaries), and it doesn't
* copy the passed-in format string. Thankfully, you can't use this
* directly, you have to use format(...) below.
```This has negative safety and performance (encourages reuse of the same formatter) implications because contrary to what the comment says you can use the object directly since it's returned from `folly::format`. For example
```
auto f = folly::format( std::string( "{}"), 42);
f.str();
```
is a UB with no compile-time diagnostic (only caught by ASAN).It's also unnecessary because the `Formatter` object is usually converted to string straight away via `str()` or written to an output stream. Reusing the formatter doesn't make much sense either because the expensive part is formatting, not capturing arguments.
This diff deprecates `folly::format` suggesting `fmt::format` as a potential replacement. `fmt::format` doesn't have the above problem because arguments are always in scope. It also has the following advantages:
* Better compile times.
* Compile-time format string checks.
* Compatibility with C++20 `std::format`.
* Better performance, particularly with format string compilation which eliminates format string processing overhead altogether.
* Smaller binary footprint.Also remove `folly::writeTo` which is no longer used and the `format_
nested_ fbstrings` benchmark which is identical to `format_ nested_ strings` since there is no `fbstr()` any more. Reviewed By: yfeldblum
Differential Revision: D26391489
fbshipit-source-id: f0309e78db0eb6d
8c22b426d4cc333 a17c53f73e - 9372. By Yedidya Feldblum <email address hidden> on 2021-02-27
-
rename co_invoke_type to co_invoke_fn
Summary: Follow a convention that function object types with corresponding function object instances be named with a `_fn` suffix.
Reviewed By: ericniebler
Differential Revision: D26674781
fbshipit-source-id: f8a3b8f18677c90
5897da8bae38cc7 6693146073 - 9371. By Yedidya Feldblum <email address hidden> on 2021-02-27
-
no coroutine_traits
Summary: Use of `std::coroutine
_traits` and `std::experimen tal::coroutine_ traits` can get awkward and we do not actually need the flexibility. Just define member type aliases `promise_type`. Reviewed By: andriigrynenko
Differential Revision: D26706363
fbshipit-source-id: 0cdb59d542a64ff
85d8a126003a014 b7b6be3134 - 9370. By Yedidya Feldblum <email address hidden> on 2021-02-27
-
access::begin, access::end
Summary: Invokers for `begin` and `end` with `std::begin` and `std::end` in scope.
Reviewed By: ericniebler
Differential Revision: D26683890
fbshipit-source-id: 79e57b235c847b5
bea29e2e6aac767 bdfcef72e8 - 9369. By Yedidya Feldblum <email address hidden> on 2021-02-27
-
let container-access interface be function-objects
Summary: Namely, let the backports of `std::size`, `std::empty`, and `std::data` be function objects in folly to eliminate possibility of ADL overloading.
Reviewed By: ericniebler
Differential Revision: D26681127
fbshipit-source-id: 0c2868f25818afc
a7efd6b2337cb39 8daa9bb7f3 - 9368. By Dan Melnic <email address hidden> on 2021-02-27
-
Add FOLLY_PORT_
WIN32_OPEN_ BINARY define Summary: Add FOLLY_PORT_
WIN32_OPEN_ BINARY define Reviewed By: yfeldblum
Differential Revision: D26693403
fbshipit-source-id: 51fb9ceef31cffd
eff691ad0eb4993 9725cc047b - 9367. By Yedidya Feldblum <email address hidden> on 2021-02-26
-
reexport remaining coroutine names
Summary: Reexport remaining names, including `noop_coroutine`, from `folly/
experimental/ coro/Coroutine. h`, which wraps inclusion of `experimental/ coroutine` . Differential Revision: D26227580
fbshipit-source-id: b7ea0bb0bb7447b
f4327b2f178c51d b544f70f46 - 9366. By Yedidya Feldblum <email address hidden> on 2021-02-26
-
cut accidental glog dep in FsUtil
Summary: TSIA
Differential Revision: D26697902
fbshipit-source-id: bd0a552959474c0
efa6167e8da1ed3 1916c77346 - 9365. By Alfred Fuller <email address hidden> on 2021-02-26
-
Fix forward_like rvalue->lvalue check
Summary: The static cast and forward were backwards. Previously it happily converted an rvalue to a const lvalue. Now it causes the exact same static_assert failure as std::forward in every rvalue->lvalue case.
Reviewed By: yfeldblum
Differential Revision: D26680263
fbshipit-source-id: f1ca4c4bfdd6333
d24fe3c406d5373 a2f72dea31
Branch metadata
- Branch format:
- Branch format 7
- Repository format:
- Bazaar repository format 2a (needs bzr 1.16 or later)