lp:folly

Created by Sam Spilsbury on 2013-05-10 and last modified on 2021-02-28
Get this branch:
bzr branch lp:folly

Branch merges

Related bugs

Related blueprints

Branch information

Owner:
Sam Spilsbury
Project:
folly
Status:
Development

Import details

Import Status: Reviewed

This branch is an import of the HEAD branch of the Git repository at git://github.com/facebook/folly.git.

The next import is scheduled to run in 2 hours.

Last successful import was 3 hours ago.

Import started 3 hours ago on alnitak and finished 3 hours ago taking 15 seconds — see the log
Import started 9 hours ago on alnitak and finished 9 hours ago taking 15 seconds — see the log
Import started 15 hours ago on alnitak and finished 15 hours ago taking 15 seconds — see the log
Import started 21 hours ago on alnitak and finished 21 hours ago taking 15 seconds — see the log
Import started on 2021-02-27 on alnitak and finished on 2021-02-27 taking 20 seconds — see the log
Import started on 2021-02-27 on izar and finished on 2021-02-27 taking 15 seconds — see the log
Import started on 2021-02-27 on alnitak and finished on 2021-02-27 taking 15 seconds — see the log
Import started on 2021-02-26 on alnitak and finished on 2021-02-26 taking 15 seconds — see the log
Import started on 2021-02-26 on alnitak and finished on 2021-02-26 taking 15 seconds — see the log
Import started on 2021-02-26 on alnitak and finished on 2021-02-26 taking 15 seconds — see the log

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: e98f64b3d3ffaf5bbd322397a41bb5fe85a6bb55

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: f0309e78db0eb6d8c22b426d4cc333a17c53f73e

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: f8a3b8f18677c905897da8bae38cc76693146073

9371. By Yedidya Feldblum <email address hidden> on 2021-02-27

no coroutine_traits

Summary: Use of `std::coroutine_traits` and `std::experimental::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: 0cdb59d542a64ff85d8a126003a014b7b6be3134

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: 79e57b235c847b5bea29e2e6aac767bdfcef72e8

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: 0c2868f25818afca7efd6b2337cb398daa9bb7f3

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: 51fb9ceef31cffdeff691ad0eb49939725cc047b

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: b7ea0bb0bb7447bf4327b2f178c51db544f70f46

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: bd0a552959474c0efa6167e8da1ed31916c77346

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: f1ca4c4bfdd6333d24fe3c406d5373a2f72dea31

Branch metadata

Branch format:
Branch format 7
Repository format:
Bazaar repository format 2a (needs bzr 1.16 or later)
This branch contains Public information 
Everyone can see this information.

Subscribers