docstring_tokens
stringlengths 18
16.9k
| code_tokens
stringlengths 75
1.81M
| html_url
stringlengths 74
116
| file_name
stringlengths 3
311
|
---|---|---|---|
keep add keep keep keep keep keep
|
<mask> Synchronized() = default;
<mask>
<mask> /**
<mask> * Copy constructor; deprecated
<mask> *
<mask> * Enabled only when the data type is copy-constructible.
<mask> *
</s> [sdk33] Update iOS with RN 0.59 </s> remove * Copy constructor copies the data (with locking the source and
* all) but does NOT copy the mutex. Doing so would result in
* deadlocks.
</s> add * Copy constructor; deprecated
*
* Enabled only when the data type is copy-constructible. </s> remove * Move constructor moves the data (with locking the source and all)
* but does not move the mutex.
</s> add * Move constructor; deprecated
*
* Move-constructs from the source data without locking either the source or
* the destination mutex. </s> remove Synchronized& operator=(const Synchronized& rhs) {
if (this == &rhs) {
// Self-assignment, pass.
} else if (this < &rhs) {
auto guard1 = operator->();
auto guard2 = rhs.operator->();
datum_ = rhs.datum_;
} else {
auto guard1 = rhs.operator->();
auto guard2 = operator->();
datum_ = rhs.datum_;
}
return *this;
</s> add template <typename... DatumArgs, typename... MutexArgs>
Synchronized(
std::piecewise_construct_t,
std::tuple<DatumArgs...> datumArgs,
std::tuple<MutexArgs...> mutexArgs)
: Synchronized{std::piecewise_construct,
std::move(datumArgs),
std::move(mutexArgs),
make_index_sequence<sizeof...(DatumArgs)>{},
make_index_sequence<sizeof...(MutexArgs)>{}} {}
/**
* Copy assignment operator; deprecated
*
* Enabled only when the data type is copy-constructible and move-assignable.
*
* Move-assigns from a copy of the source data.
*
* Takes a shared-or-exclusive lock on the source mutex while copying the
* source data to a temporary. Takes an exclusive lock on the destination
* mutex while move-assigning from the temporary.
*
* This technique consts an extra temporary but avoids the need to take locks
* on both mutexes together.
*/
Synchronized& operator=(typename std::conditional<
std::is_copy_constructible<T>::value &&
std::is_move_assignable<T>::value,
const Synchronized&,
NonImplementedType>::type rhs) {
return *this = rhs.copy(); </s> remove * Note that the copy constructor may throw because it acquires a lock in
* the contextualRLock() method
</s> add * Takes a shared-or-exclusive lock on the source mutex while performing the
* copy-construction of the destination data from the source data. No lock is
* taken on the destination mutex.
*
* May throw even when the data type is is nothrow-copy-constructible because
* acquiring a lock may throw. </s> remove ParameterizedTokenBucket(const ParameterizedTokenBucket& other) noexcept =
default;
</s> add BasicTokenBucket(const BasicTokenBucket& other) noexcept = default; </s> remove * Move assignment operator, only assigns the data, NOT the
* mutex. It locks the two objects in ascending order of their
* addresses.
</s> add * Move assignment operator; deprecated
*
* Takes an exclusive lock on the destination mutex while move-assigning the
* destination data from the source data. The source mutex is not locked or
* otherwise accessed.
*
* Semantically, assumes that the source object is a true rvalue and therefore
* that no synchronization is required for accessing it.
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep replace replace replace keep replace replace keep
|
<mask> /**
<mask> * Copy constructor copies the data (with locking the source and
<mask> * all) but does NOT copy the mutex. Doing so would result in
<mask> * deadlocks.
<mask> *
<mask> * Note that the copy constructor may throw because it acquires a lock in
<mask> * the contextualRLock() method
<mask> */
</s> [sdk33] Update iOS with RN 0.59 </s> remove Synchronized(const Synchronized& rhs) /* may throw */
: Synchronized(rhs, rhs.contextualRLock()) {}
</s> add /* implicit */ Synchronized(typename std::conditional<
std::is_copy_constructible<T>::value,
const Synchronized&,
NonImplementedType>::type rhs) /* may throw */
: Synchronized(rhs.copy()) {} </s> remove * Move constructor moves the data (with locking the source and all)
* but does not move the mutex.
</s> add * Move constructor; deprecated
*
* Move-constructs from the source data without locking either the source or
* the destination mutex. </s> remove * Note that the move constructor may throw because it acquires a lock.
* Since the move constructor is not declared noexcept, when objects of this
* class are used as elements in a vector or a similar container. The
* elements might not be moved around when resizing. They might be copied
* instead. You have been warned.
</s> add * Semantically, assumes that the source object is a true rvalue and therefore
* that no synchronization is required for accessing it. </s> remove Synchronized& operator=(const Synchronized& rhs) {
if (this == &rhs) {
// Self-assignment, pass.
} else if (this < &rhs) {
auto guard1 = operator->();
auto guard2 = rhs.operator->();
datum_ = rhs.datum_;
} else {
auto guard1 = rhs.operator->();
auto guard2 = operator->();
datum_ = rhs.datum_;
}
return *this;
</s> add template <typename... DatumArgs, typename... MutexArgs>
Synchronized(
std::piecewise_construct_t,
std::tuple<DatumArgs...> datumArgs,
std::tuple<MutexArgs...> mutexArgs)
: Synchronized{std::piecewise_construct,
std::move(datumArgs),
std::move(mutexArgs),
make_index_sequence<sizeof...(DatumArgs)>{},
make_index_sequence<sizeof...(MutexArgs)>{}} {}
/**
* Copy assignment operator; deprecated
*
* Enabled only when the data type is copy-constructible and move-assignable.
*
* Move-assigns from a copy of the source data.
*
* Takes a shared-or-exclusive lock on the source mutex while copying the
* source data to a temporary. Takes an exclusive lock on the destination
* mutex while move-assigning from the temporary.
*
* This technique consts an extra temporary but avoids the need to take locks
* on both mutexes together.
*/
Synchronized& operator=(typename std::conditional<
std::is_copy_constructible<T>::value &&
std::is_move_assignable<T>::value,
const Synchronized&,
NonImplementedType>::type rhs) {
return *this = rhs.copy(); </s> remove * Move assignment operator, only assigns the data, NOT the
* mutex. It locks the two objects in ascending order of their
* addresses.
</s> add * Move assignment operator; deprecated
*
* Takes an exclusive lock on the destination mutex while move-assigning the
* destination data from the source data. The source mutex is not locked or
* otherwise accessed.
*
* Semantically, assumes that the source object is a true rvalue and therefore
* that no synchronization is required for accessing it.
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep keep keep replace replace keep keep replace replace keep keep keep keep
|
<mask> * Note that the copy constructor may throw because it acquires a lock in
<mask> * the contextualRLock() method
<mask> */
<mask> Synchronized(const Synchronized& rhs) /* may throw */
<mask> : Synchronized(rhs, rhs.contextualRLock()) {}
<mask>
<mask> /**
<mask> * Move constructor moves the data (with locking the source and all)
<mask> * but does not move the mutex.
<mask> *
<mask> * Note that the move constructor may throw because it acquires a lock.
<mask> * Since the move constructor is not declared noexcept, when objects of this
<mask> * class are used as elements in a vector or a similar container. The
</s> [sdk33] Update iOS with RN 0.59 </s> remove * Note that the move constructor may throw because it acquires a lock.
* Since the move constructor is not declared noexcept, when objects of this
* class are used as elements in a vector or a similar container. The
* elements might not be moved around when resizing. They might be copied
* instead. You have been warned.
</s> add * Semantically, assumes that the source object is a true rvalue and therefore
* that no synchronization is required for accessing it. </s> remove * Note that the copy constructor may throw because it acquires a lock in
* the contextualRLock() method
</s> add * Takes a shared-or-exclusive lock on the source mutex while performing the
* copy-construction of the destination data from the source data. No lock is
* taken on the destination mutex.
*
* May throw even when the data type is is nothrow-copy-constructible because
* acquiring a lock may throw. </s> remove * Copy constructor copies the data (with locking the source and
* all) but does NOT copy the mutex. Doing so would result in
* deadlocks.
</s> add * Copy constructor; deprecated
*
* Enabled only when the data type is copy-constructible. </s> remove Synchronized(Synchronized&& rhs) /* may throw */
: Synchronized(std::move(rhs), rhs.contextualLock()) {}
</s> add Synchronized(Synchronized&& rhs) noexcept(nxMoveCtor)
: Synchronized(std::move(rhs.datum_)) {} </s> remove * Move assignment operator, only assigns the data, NOT the
* mutex. It locks the two objects in ascending order of their
* addresses.
</s> add * Move assignment operator; deprecated
*
* Takes an exclusive lock on the destination mutex while move-assigning the
* destination data from the source data. The source mutex is not locked or
* otherwise accessed.
*
* Semantically, assumes that the source object is a true rvalue and therefore
* that no synchronization is required for accessing it.
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep keep keep keep replace replace replace replace replace keep replace replace keep keep keep
|
<mask> /**
<mask> * Move constructor moves the data (with locking the source and all)
<mask> * but does not move the mutex.
<mask> *
<mask> * Note that the move constructor may throw because it acquires a lock.
<mask> * Since the move constructor is not declared noexcept, when objects of this
<mask> * class are used as elements in a vector or a similar container. The
<mask> * elements might not be moved around when resizing. They might be copied
<mask> * instead. You have been warned.
<mask> */
<mask> Synchronized(Synchronized&& rhs) /* may throw */
<mask> : Synchronized(std::move(rhs), rhs.contextualLock()) {}
<mask>
<mask> /**
<mask> * Constructor taking a datum as argument copies it. There is no
</s> [sdk33] Update iOS with RN 0.59 </s> remove * Move constructor moves the data (with locking the source and all)
* but does not move the mutex.
</s> add * Move constructor; deprecated
*
* Move-constructs from the source data without locking either the source or
* the destination mutex. </s> remove Synchronized(const Synchronized& rhs) /* may throw */
: Synchronized(rhs, rhs.contextualRLock()) {}
</s> add /* implicit */ Synchronized(typename std::conditional<
std::is_copy_constructible<T>::value,
const Synchronized&,
NonImplementedType>::type rhs) /* may throw */
: Synchronized(rhs.copy()) {} </s> remove * Copy constructor copies the data (with locking the source and
* all) but does NOT copy the mutex. Doing so would result in
* deadlocks.
</s> add * Copy constructor; deprecated
*
* Enabled only when the data type is copy-constructible. </s> remove * Note that the copy constructor may throw because it acquires a lock in
* the contextualRLock() method
</s> add * Takes a shared-or-exclusive lock on the source mutex while performing the
* copy-construction of the destination data from the source data. No lock is
* taken on the destination mutex.
*
* May throw even when the data type is is nothrow-copy-constructible because
* acquiring a lock may throw. </s> remove * \note `typename = ResultOf<Fun>` prevents this overload from being
* selected by overload resolution when `fun` is not a compatible function.
</s> add * \note `typename Traits::template ResultOf<Fun>` prevents this overload
* from being selected by overload resolution when `fun` is not a compatible
* function.
*
* \note The noexcept requires some explanation. `IsSmall` is true when the
* decayed type fits within the internal buffer and is noexcept-movable. But
* this ctor might copy, not move. What we need here, if this ctor does a
* copy, is that this ctor be noexcept when the copy is noexcept. That is not
* checked in `IsSmall`, and shouldn't be, because once the `Function` is
* constructed, the contained object is never copied. This check is for this
* ctor only, in the case that this ctor does a copy.
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep keep keep replace keep keep replace keep keep
|
<mask>
<mask> /**
<mask> * Lets you construct non-movable types in-place. Use the constexpr
<mask> * instance `construct_in_place` as the first argument.
<mask> */
<mask> template <typename... Args>
<mask> explicit Synchronized(construct_in_place_t, Args&&... args)
<mask> : datum_(std::forward<Args>(args)...) {}
<mask>
</s> [sdk33] Update iOS with RN 0.59 </s> remove * The canonical assignment operator only assigns the data, NOT the
* mutex. It locks the two objects in ascending order of their
* addresses.
</s> add * Lets you construct the synchronized object and also pass construction
* parameters to the underlying mutex if desired </s> remove : impl_(std::forward<Args>(args)...) {}
CachelinePadded() {}
</s> add : inner_(std::forward<Args>(args)...) {} </s> add static_assert(
alignof(T) <= max_align_v,
"CachelinePadded does not support over-aligned types.");
</s> remove template <class SynchronizedType, class LockPolicy>
class LockedGuardPtr {
private:
// CDataType is the DataType with the appropriate const-qualification
using CDataType = detail::SynchronizedDataType<SynchronizedType>;
public:
using DataType = typename SynchronizedType::DataType;
using MutexType = typename SynchronizedType::MutexType;
using Synchronized = typename std::remove_const<SynchronizedType>::type;
LockedGuardPtr() = delete;
/**
* Takes a Synchronized<T> and locks it.
*/
explicit LockedGuardPtr(SynchronizedType* parent) : parent_(parent) {
LockPolicy::lock(parent_->mutex_);
}
/**
* Destructor releases.
*/
~LockedGuardPtr() {
LockPolicy::unlock(parent_->mutex_);
}
/**
* Access the locked data.
*/
CDataType* operator->() const {
return &parent_->datum_;
}
</s> add template <typename D, typename M, typename... Args>
auto wlock(Synchronized<D, M>& synchronized, Args&&... args) {
return detail::wlock(synchronized, std::forward<Args>(args)...);
}
template <typename Data, typename Mutex, typename... Args>
auto rlock(const Synchronized<Data, Mutex>& synchronized, Args&&... args) {
return detail::rlock(synchronized, std::forward<Args>(args)...);
}
template <typename D, typename M, typename... Args>
auto ulock(Synchronized<D, M>& synchronized, Args&&... args) {
return detail::ulock(synchronized, std::forward<Args>(args)...);
}
template <typename D, typename M, typename... Args>
auto lock(Synchronized<D, M>& synchronized, Args&&... args) {
return detail::lock(synchronized, std::forward<Args>(args)...);
}
template <typename D, typename M, typename... Args>
auto lock(const Synchronized<D, M>& synchronized, Args&&... args) {
return detail::lock(synchronized, std::forward<Args>(args)...);
} </s> remove class BadFormatArg : public std::invalid_argument {
public:
explicit BadFormatArg(const std::string& msg)
: std::invalid_argument(msg) {}
</s> add class FOLLY_EXPORT BadFormatArg : public std::invalid_argument {
using invalid_argument::invalid_argument;
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep keep keep keep replace replace replace keep replace replace replace replace replace replace replace replace replace replace replace replace replace keep
|
<mask> explicit Synchronized(construct_in_place_t, Args&&... args)
<mask> : datum_(std::forward<Args>(args)...) {}
<mask>
<mask> /**
<mask> * The canonical assignment operator only assigns the data, NOT the
<mask> * mutex. It locks the two objects in ascending order of their
<mask> * addresses.
<mask> */
<mask> Synchronized& operator=(const Synchronized& rhs) {
<mask> if (this == &rhs) {
<mask> // Self-assignment, pass.
<mask> } else if (this < &rhs) {
<mask> auto guard1 = operator->();
<mask> auto guard2 = rhs.operator->();
<mask> datum_ = rhs.datum_;
<mask> } else {
<mask> auto guard1 = rhs.operator->();
<mask> auto guard2 = operator->();
<mask> datum_ = rhs.datum_;
<mask> }
<mask> return *this;
<mask> }
</s> [sdk33] Update iOS with RN 0.59 </s> remove if (this == &rhs) {
// Self-assignment, pass.
} else if (this < &rhs) {
auto guard1 = operator->();
auto guard2 = rhs.operator->();
datum_ = std::move(rhs.datum_);
} else {
auto guard1 = rhs.operator->();
auto guard2 = operator->();
datum_ = std::move(rhs.datum_);
}
return *this;
</s> add return *this = std::move(rhs.datum_); </s> remove * Move assignment operator, only assigns the data, NOT the
* mutex. It locks the two objects in ascending order of their
* addresses.
</s> add * Move assignment operator; deprecated
*
* Takes an exclusive lock on the destination mutex while move-assigning the
* destination data from the source data. The source mutex is not locked or
* otherwise accessed.
*
* Semantically, assumes that the source object is a true rvalue and therefore
* that no synchronization is required for accessing it. </s> remove auto guard = operator->();
datum_ = rhs;
</s> add if (&datum_ != &rhs) {
auto guard = operator->();
datum_ = rhs;
} </s> remove explicit Synchronized(construct_in_place_t, Args&&... args)
</s> add explicit Synchronized(in_place_t, Args&&... args) </s> remove auto guard = operator->();
datum_ = std::move(rhs);
</s> add if (&datum_ != &rhs) {
auto guard = operator->();
datum_ = std::move(rhs);
}
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep replace replace replace keep keep replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep
|
<mask> /**
<mask> * Move assignment operator, only assigns the data, NOT the
<mask> * mutex. It locks the two objects in ascending order of their
<mask> * addresses.
<mask> */
<mask> Synchronized& operator=(Synchronized&& rhs) {
<mask> if (this == &rhs) {
<mask> // Self-assignment, pass.
<mask> } else if (this < &rhs) {
<mask> auto guard1 = operator->();
<mask> auto guard2 = rhs.operator->();
<mask> datum_ = std::move(rhs.datum_);
<mask> } else {
<mask> auto guard1 = rhs.operator->();
<mask> auto guard2 = operator->();
<mask> datum_ = std::move(rhs.datum_);
<mask> }
<mask> return *this;
<mask> }
<mask>
<mask> /**
</s> [sdk33] Update iOS with RN 0.59 </s> remove Synchronized& operator=(const Synchronized& rhs) {
if (this == &rhs) {
// Self-assignment, pass.
} else if (this < &rhs) {
auto guard1 = operator->();
auto guard2 = rhs.operator->();
datum_ = rhs.datum_;
} else {
auto guard1 = rhs.operator->();
auto guard2 = operator->();
datum_ = rhs.datum_;
}
return *this;
</s> add template <typename... DatumArgs, typename... MutexArgs>
Synchronized(
std::piecewise_construct_t,
std::tuple<DatumArgs...> datumArgs,
std::tuple<MutexArgs...> mutexArgs)
: Synchronized{std::piecewise_construct,
std::move(datumArgs),
std::move(mutexArgs),
make_index_sequence<sizeof...(DatumArgs)>{},
make_index_sequence<sizeof...(MutexArgs)>{}} {}
/**
* Copy assignment operator; deprecated
*
* Enabled only when the data type is copy-constructible and move-assignable.
*
* Move-assigns from a copy of the source data.
*
* Takes a shared-or-exclusive lock on the source mutex while copying the
* source data to a temporary. Takes an exclusive lock on the destination
* mutex while move-assigning from the temporary.
*
* This technique consts an extra temporary but avoids the need to take locks
* on both mutexes together.
*/
Synchronized& operator=(typename std::conditional<
std::is_copy_constructible<T>::value &&
std::is_move_assignable<T>::value,
const Synchronized&,
NonImplementedType>::type rhs) {
return *this = rhs.copy(); </s> remove * The canonical assignment operator only assigns the data, NOT the
* mutex. It locks the two objects in ascending order of their
* addresses.
</s> add * Lets you construct the synchronized object and also pass construction
* parameters to the underlying mutex if desired </s> remove auto guard = operator->();
datum_ = std::move(rhs);
</s> add if (&datum_ != &rhs) {
auto guard = operator->();
datum_ = std::move(rhs);
} </s> remove auto guard = operator->();
datum_ = rhs;
</s> add if (&datum_ != &rhs) {
auto guard = operator->();
datum_ = rhs;
} </s> remove explicit Synchronized(construct_in_place_t, Args&&... args)
</s> add explicit Synchronized(in_place_t, Args&&... args)
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask> /**
<mask> * Lock object, assign datum.
<mask> */
<mask> Synchronized& operator=(const T& rhs) {
<mask> auto guard = operator->();
<mask> datum_ = rhs;
<mask> return *this;
<mask> }
<mask>
<mask> /**
<mask> * Lock object, move-assign datum.
</s> [sdk33] Update iOS with RN 0.59 </s> remove auto guard = operator->();
datum_ = std::move(rhs);
</s> add if (&datum_ != &rhs) {
auto guard = operator->();
datum_ = std::move(rhs);
} </s> remove if (this == &rhs) {
// Self-assignment, pass.
} else if (this < &rhs) {
auto guard1 = operator->();
auto guard2 = rhs.operator->();
datum_ = std::move(rhs.datum_);
} else {
auto guard1 = rhs.operator->();
auto guard2 = operator->();
datum_ = std::move(rhs.datum_);
}
return *this;
</s> add return *this = std::move(rhs.datum_); </s> remove Synchronized& operator=(const Synchronized& rhs) {
if (this == &rhs) {
// Self-assignment, pass.
} else if (this < &rhs) {
auto guard1 = operator->();
auto guard2 = rhs.operator->();
datum_ = rhs.datum_;
} else {
auto guard1 = rhs.operator->();
auto guard2 = operator->();
datum_ = rhs.datum_;
}
return *this;
</s> add template <typename... DatumArgs, typename... MutexArgs>
Synchronized(
std::piecewise_construct_t,
std::tuple<DatumArgs...> datumArgs,
std::tuple<MutexArgs...> mutexArgs)
: Synchronized{std::piecewise_construct,
std::move(datumArgs),
std::move(mutexArgs),
make_index_sequence<sizeof...(DatumArgs)>{},
make_index_sequence<sizeof...(MutexArgs)>{}} {}
/**
* Copy assignment operator; deprecated
*
* Enabled only when the data type is copy-constructible and move-assignable.
*
* Move-assigns from a copy of the source data.
*
* Takes a shared-or-exclusive lock on the source mutex while copying the
* source data to a temporary. Takes an exclusive lock on the destination
* mutex while move-assigning from the temporary.
*
* This technique consts an extra temporary but avoids the need to take locks
* on both mutexes together.
*/
Synchronized& operator=(typename std::conditional<
std::is_copy_constructible<T>::value &&
std::is_move_assignable<T>::value,
const Synchronized&,
NonImplementedType>::type rhs) {
return *this = rhs.copy(); </s> remove /**
* Sometimes, although you have a mutable object, you only want to
* call a const method against it. The most efficient way to achieve
* that is by using a read lock. You get to do so by using
* obj.asConst()->method() instead of obj->method().
*
* NOTE: This API is planned to be deprecated in an upcoming diff.
* Use rlock() instead.
*/
const Synchronized& asConst() const {
return *this;
}
</s> add </s> remove return static_cast<ReturnType>(detail::function::invoke(
*static_cast<Fun*>(object), static_cast<Args&&>(args)...));
</s> add using Pointer = _t<std::add_pointer<Fun>>;
return static_cast<ReturnType>(invoke(
static_cast<Fun&&>(*static_cast<Pointer>(object)),
static_cast<Args&&>(args)...)); </s> remove * The canonical assignment operator only assigns the data, NOT the
* mutex. It locks the two objects in ascending order of their
* addresses.
</s> add * Lets you construct the synchronized object and also pass construction
* parameters to the underlying mutex if desired
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask> /**
<mask> * Lock object, move-assign datum.
<mask> */
<mask> Synchronized& operator=(T&& rhs) {
<mask> auto guard = operator->();
<mask> datum_ = std::move(rhs);
<mask> return *this;
<mask> }
<mask>
<mask> /**
<mask> * Acquire an appropriate lock based on the context.
</s> [sdk33] Update iOS with RN 0.59 </s> remove auto guard = operator->();
datum_ = rhs;
</s> add if (&datum_ != &rhs) {
auto guard = operator->();
datum_ = rhs;
} </s> remove if (this == &rhs) {
// Self-assignment, pass.
} else if (this < &rhs) {
auto guard1 = operator->();
auto guard2 = rhs.operator->();
datum_ = std::move(rhs.datum_);
} else {
auto guard1 = rhs.operator->();
auto guard2 = operator->();
datum_ = std::move(rhs.datum_);
}
return *this;
</s> add return *this = std::move(rhs.datum_); </s> remove Synchronized& operator=(const Synchronized& rhs) {
if (this == &rhs) {
// Self-assignment, pass.
} else if (this < &rhs) {
auto guard1 = operator->();
auto guard2 = rhs.operator->();
datum_ = rhs.datum_;
} else {
auto guard1 = rhs.operator->();
auto guard2 = operator->();
datum_ = rhs.datum_;
}
return *this;
</s> add template <typename... DatumArgs, typename... MutexArgs>
Synchronized(
std::piecewise_construct_t,
std::tuple<DatumArgs...> datumArgs,
std::tuple<MutexArgs...> mutexArgs)
: Synchronized{std::piecewise_construct,
std::move(datumArgs),
std::move(mutexArgs),
make_index_sequence<sizeof...(DatumArgs)>{},
make_index_sequence<sizeof...(MutexArgs)>{}} {}
/**
* Copy assignment operator; deprecated
*
* Enabled only when the data type is copy-constructible and move-assignable.
*
* Move-assigns from a copy of the source data.
*
* Takes a shared-or-exclusive lock on the source mutex while copying the
* source data to a temporary. Takes an exclusive lock on the destination
* mutex while move-assigning from the temporary.
*
* This technique consts an extra temporary but avoids the need to take locks
* on both mutexes together.
*/
Synchronized& operator=(typename std::conditional<
std::is_copy_constructible<T>::value &&
std::is_move_assignable<T>::value,
const Synchronized&,
NonImplementedType>::type rhs) {
return *this = rhs.copy(); </s> remove * Move assignment operator, only assigns the data, NOT the
* mutex. It locks the two objects in ascending order of their
* addresses.
</s> add * Move assignment operator; deprecated
*
* Takes an exclusive lock on the destination mutex while move-assigning the
* destination data from the source data. The source mutex is not locked or
* otherwise accessed.
*
* Semantically, assumes that the source object is a true rvalue and therefore
* that no synchronization is required for accessing it. </s> add /**
* Assign another datum and return the original value. Recommended
* because it keeps the mutex held only briefly.
*/
T exchange(T&& rhs) {
swap(rhs);
return std::move(rhs);
}
</s> add /**
* Returns the current time in seconds since Epoch.
*/
static double defaultClockNow() noexcept {
using dur = std::chrono::duration<double>;
auto const now = Clock::now().time_since_epoch();
return std::chrono::duration_cast<dur>(now).count();
}
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> }
<mask>
<mask> /**
<mask> * Attempts to acquire for a given number of milliseconds. If
<mask> * acquisition is unsuccessful, the returned LockedPtr is NULL.
<mask> *
<mask> * NOTE: This API is deprecated. Use lock(), wlock(), or rlock() instead.
<mask> * In the future it will be marked with a deprecation attribute to emit
<mask> * build-time warnings, and then it will be removed entirely.
<mask> */
</s> [sdk33] Update iOS with RN 0.59 </s> remove * acquisition is unsuccessful, the returned ConstLockedPtr is NULL.
</s> add * acquisition is unsuccessful, the returned ConstLockedPtr is nullptr. </s> add /**
* Attempts to acquire the lock in exclusive mode. If acquisition is
* unsuccessful, the returned LockedPtr will be null.
*
* (Use LockedPtr::operator bool() or LockedPtr::isNull() to check for
* validity.)
*/
TryLockedPtr tryLock() {
return TryLockedPtr{static_cast<Subclass*>(this)};
}
ConstTryLockedPtr tryLock() const {
return ConstTryLockedPtr{static_cast<const Subclass*>(this)};
}
</s> remove /**
* Sometimes, although you have a mutable object, you only want to
* call a const method against it. The most efficient way to achieve
* that is by using a read lock. You get to do so by using
* obj.asConst()->method() instead of obj->method().
*
* NOTE: This API is planned to be deprecated in an upcoming diff.
* Use rlock() instead.
*/
const Synchronized& asConst() const {
return *this;
}
</s> add </s> remove * The relationship between LockedGuardPtr and LockedPtr is similar to that
* between std::lock_guard and std::unique_lock.
</s> add * For example in the above rlock() produces an implementation defined read
* locking helper instance and wlock() a write locking helper
*
* Subsequent arguments passed to these locking helpers, after the first, will
* be passed by const-ref to the corresponding function on the synchronized
* instance. This means that if the function accepts these parameters by
* value, they will be copied. Note that it is not necessary that the primary
* locking function will be invoked at all (for eg. the implementation might
* just invoke the try*Lock() method)
*
* // Try to acquire the lock for one second
* synchronized([](auto) { ... }, wlock(one, 1s));
*
* // The timed lock acquire might never actually be called, if it is not
* // needed by the underlying deadlock avoiding algorithm
* synchronized([](auto, auto) { ... }, rlock(one), wlock(two, 1s));
*
* Note that the arguments passed to to *lock() calls will be passed by
* const-ref to the function invocation, as the implementation might use them
* many times </s> remove /**
* Access the locked data.
*/
CDataType& operator*() const {
return parent_->datum_;
}
</s> add /**
* Acquire locks for multiple Synchronized<> objects, in a deadlock-safe
* manner.
*
* Wrap the synchronized instances with the appropriate locking strategy by
* using one of the four strategies - folly::lock (exclusive acquire for
* exclusive only mutexes), folly::rlock (shared acquire for shareable
* mutexes), folly::wlock (exclusive acquire for shareable mutexes) or
* folly::ulock (upgrade acquire for upgrade mutexes) (see above)
*
* The locks will be acquired and the passed callable will be invoked with the
* LockedPtr instances in the order that they were passed to the function
*/
template <typename Func, typename... SynchronizedLockers>
decltype(auto) synchronized(Func&& func, SynchronizedLockers&&... lockers) {
return apply(
std::forward<Func>(func),
lock(std::forward<SynchronizedLockers>(lockers)...));
} </s> remove * LockedGuardPtr is a simplified version of LockedPtr.
</s> add * Helper functions that should be passed to either a lock() or synchronized()
* invocation, these return implementation defined structs that will be used
* to lock the synchronized instance appropriately.
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> }
<mask>
<mask> /**
<mask> * Attempts to acquire for a given number of milliseconds. If
<mask> * acquisition is unsuccessful, the returned ConstLockedPtr is NULL.
<mask> *
<mask> * NOTE: This API is deprecated. Use lock(), wlock(), or rlock() instead.
<mask> * In the future it will be marked with a deprecation attribute to emit
<mask> * build-time warnings, and then it will be removed entirely.
<mask> */
</s> [sdk33] Update iOS with RN 0.59 </s> remove * acquisition is unsuccessful, the returned LockedPtr is NULL.
</s> add * acquisition is unsuccessful, the returned LockedPtr is nullptr. </s> add /**
* Attempts to acquire the lock in exclusive mode. If acquisition is
* unsuccessful, the returned LockedPtr will be null.
*
* (Use LockedPtr::operator bool() or LockedPtr::isNull() to check for
* validity.)
*/
TryLockedPtr tryLock() {
return TryLockedPtr{static_cast<Subclass*>(this)};
}
ConstTryLockedPtr tryLock() const {
return ConstTryLockedPtr{static_cast<const Subclass*>(this)};
}
</s> remove /**
* Sometimes, although you have a mutable object, you only want to
* call a const method against it. The most efficient way to achieve
* that is by using a read lock. You get to do so by using
* obj.asConst()->method() instead of obj->method().
*
* NOTE: This API is planned to be deprecated in an upcoming diff.
* Use rlock() instead.
*/
const Synchronized& asConst() const {
return *this;
}
</s> add </s> remove * The relationship between LockedGuardPtr and LockedPtr is similar to that
* between std::lock_guard and std::unique_lock.
</s> add * For example in the above rlock() produces an implementation defined read
* locking helper instance and wlock() a write locking helper
*
* Subsequent arguments passed to these locking helpers, after the first, will
* be passed by const-ref to the corresponding function on the synchronized
* instance. This means that if the function accepts these parameters by
* value, they will be copied. Note that it is not necessary that the primary
* locking function will be invoked at all (for eg. the implementation might
* just invoke the try*Lock() method)
*
* // Try to acquire the lock for one second
* synchronized([](auto) { ... }, wlock(one, 1s));
*
* // The timed lock acquire might never actually be called, if it is not
* // needed by the underlying deadlock avoiding algorithm
* synchronized([](auto, auto) { ... }, rlock(one), wlock(two, 1s));
*
* Note that the arguments passed to to *lock() calls will be passed by
* const-ref to the function invocation, as the implementation might use them
* many times </s> remove * LockedGuardPtr is a simplified version of LockedPtr.
</s> add * Helper functions that should be passed to either a lock() or synchronized()
* invocation, these return implementation defined structs that will be used
* to lock the synchronized instance appropriately. </s> remove /**
* Access the locked data.
*/
CDataType& operator*() const {
return parent_->datum_;
}
</s> add /**
* Acquire locks for multiple Synchronized<> objects, in a deadlock-safe
* manner.
*
* Wrap the synchronized instances with the appropriate locking strategy by
* using one of the four strategies - folly::lock (exclusive acquire for
* exclusive only mutexes), folly::rlock (shared acquire for shareable
* mutexes), folly::wlock (exclusive acquire for shareable mutexes) or
* folly::ulock (upgrade acquire for upgrade mutexes) (see above)
*
* The locks will be acquired and the passed callable will be invoked with the
* LockedPtr instances in the order that they were passed to the function
*/
template <typename Func, typename... SynchronizedLockers>
decltype(auto) synchronized(Func&& func, SynchronizedLockers&&... lockers) {
return apply(
std::forward<Func>(func),
lock(std::forward<SynchronizedLockers>(lockers)...));
}
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
|
<mask> ConstLockedPtr timedAcquire(unsigned int milliseconds) const {
<mask> return ConstLockedPtr(this, std::chrono::milliseconds(milliseconds));
<mask> }
<mask>
<mask> /**
<mask> * Sometimes, although you have a mutable object, you only want to
<mask> * call a const method against it. The most efficient way to achieve
<mask> * that is by using a read lock. You get to do so by using
<mask> * obj.asConst()->method() instead of obj->method().
<mask> *
<mask> * NOTE: This API is planned to be deprecated in an upcoming diff.
<mask> * Use rlock() instead.
<mask> */
<mask> const Synchronized& asConst() const {
<mask> return *this;
<mask> }
<mask>
<mask> /**
<mask> * Swaps with another Synchronized. Protected against
<mask> * self-swap. Only data is swapped. Locks are acquired in increasing
<mask> * address order.
<mask> */
</s> [sdk33] Update iOS with RN 0.59 </s> remove * acquisition is unsuccessful, the returned ConstLockedPtr is NULL.
</s> add * acquisition is unsuccessful, the returned ConstLockedPtr is nullptr. </s> remove * acquisition is unsuccessful, the returned LockedPtr is NULL.
</s> add * acquisition is unsuccessful, the returned LockedPtr is nullptr. </s> add /**
* Disambiguate the name var by concatenating the line number of the original
* point of expansion. This avoids shadowing warnings for nested
* SYNCHRONIZEDs. The name is consistent if used multiple times within
* another macro.
* Only for internal use.
*/
#define SYNCHRONIZED_VAR(var) FB_CONCATENATE(SYNCHRONIZED_##var##_, __LINE__)
</s> remove private:
// This is the entire state of LockedGuardPtr.
SynchronizedType* const parent_{nullptr};
};
</s> add /**
* Acquire locks on many lockables or synchronized instances in such a way
* that the sequence of calls within the function does not cause deadlocks.
*
* This can often result in a performance boost as compared to simply
* acquiring your locks in an ordered manner. Even for very simple cases.
* The algorithm tried to adjust to contention by blocking on the mutex it
* thinks is the best fit, leaving all other mutexes open to be locked by
* other threads. See the benchmarks in folly/test/SynchronizedBenchmark.cpp
* for more
*
* This works differently as compared to the locking algorithm in libstdc++
* and is the recommended way to acquire mutexes in a generic order safe
* manner. Performance benchmarks show that this does better than the one in
* libstdc++ even for the simple cases
*
* Usage is the same as std::lock() for arbitrary lockables
*
* folly::lock(one, two, three);
*
* To make it work with folly::Synchronized you have to specify how you want
* the locks to be acquired, use the folly::wlock(), folly::rlock(),
* folly::ulock() and folly::lock() helpers defined below
*
* auto [one, two] = lock(folly::wlock(a), folly::rlock(b));
*
* Note that you can/must avoid the folly:: namespace prefix on the lock()
* function if you use the helpers, ADL lookup is done to find the lock function
*
* This will execute the deadlock avoidance algorithm and acquire a write lock
* for a and a read lock for b
*/
template <typename LockableOne, typename LockableTwo, typename... Lockables>
void lock(LockableOne& one, LockableTwo& two, Lockables&... lockables) {
auto locker = [](auto& lockable) {
using Lockable = std::remove_reference_t<decltype(lockable)>;
return detail::makeSynchronizedLocker(
lockable,
[](auto& l) { return std::unique_lock<Lockable>{l}; },
[](auto& l) {
auto lock = std::unique_lock<Lockable>{l, std::defer_lock};
lock.try_lock();
return lock;
});
};
auto locks = lock(locker(one), locker(two), locker(lockables)...);
// release ownership of the locks from the RAII lock wrapper returned by the
// function above
for_each(locks, [&](auto& lock) { lock.release(); });
} </s> remove *
</s> add </s> remove /**
* Access the locked data.
*/
CDataType& operator*() const {
return parent_->datum_;
}
</s> add /**
* Acquire locks for multiple Synchronized<> objects, in a deadlock-safe
* manner.
*
* Wrap the synchronized instances with the appropriate locking strategy by
* using one of the four strategies - folly::lock (exclusive acquire for
* exclusive only mutexes), folly::rlock (shared acquire for shareable
* mutexes), folly::wlock (exclusive acquire for shareable mutexes) or
* folly::ulock (upgrade acquire for upgrade mutexes) (see above)
*
* The locks will be acquired and the passed callable will be invoked with the
* LockedPtr instances in the order that they were passed to the function
*/
template <typename Func, typename... SynchronizedLockers>
decltype(auto) synchronized(Func&& func, SynchronizedLockers&&... lockers) {
return apply(
std::forward<Func>(func),
lock(std::forward<SynchronizedLockers>(lockers)...));
}
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep keep add keep keep keep keep keep keep
|
<mask> swap(datum_, rhs);
<mask> }
<mask>
<mask> /**
<mask> * Copies datum to a given target.
<mask> */
<mask> void copy(T* target) const {
<mask> ConstLockedPtr guard(this);
<mask> *target = datum_;
</s> [sdk33] Update iOS with RN 0.59 </s> remove /*
* Note: C++ 17 adds guaranteed copy elision. (http://wg21.link/P0135)
* Once compilers support this, it would be nice to add guard() methods that
* return LockedGuardPtr objects.
*/
</s> add </s> remove * acquisition is unsuccessful, the returned ConstLockedPtr is NULL.
</s> add * acquisition is unsuccessful, the returned ConstLockedPtr is nullptr. </s> remove lock_ = std::move(rhs.lock_);
parent_ = rhs.parent_;
rhs.parent_ = nullptr;
</s> add assignImpl(*this, rhs); </s> remove /**
* Sometimes, although you have a mutable object, you only want to
* call a const method against it. The most efficient way to achieve
* that is by using a read lock. You get to do so by using
* obj.asConst()->method() instead of obj->method().
*
* NOTE: This API is planned to be deprecated in an upcoming diff.
* Use rlock() instead.
*/
const Synchronized& asConst() const {
return *this;
}
</s> add </s> remove fbstring_core & operator=(const fbstring_core & rhs);
</s> add fbstring_core& operator=(const fbstring_core& rhs); </s> remove private:
</s> add private:
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask> template <class LockedType, class MutexType, class LockPolicy>
<mask> friend class folly::LockedPtrBase;
<mask> template <class LockedType, class LockPolicy>
<mask> friend class folly::LockedPtr;
<mask> template <class LockedType, class LockPolicy>
<mask> friend class folly::LockedGuardPtr;
<mask>
<mask> /**
<mask> * Helper constructors to enable Synchronized for
<mask> * non-default constructible types T.
<mask> * Guards are created in actual public constructors and are alive
</s> [sdk33] Update iOS with RN 0.59 </s> add /**
* Friend all instantiations of LockedPtr and LockedPtrBase
*/
template <typename S, typename L>
friend class folly::LockedPtr;
template <typename S, typename M, typename L>
friend class LockedPtrBase;
</s> remove class Iterator : public boost::iterator_facade<
Iterator, // Derived
T, // value_type
boost::bidirectional_traversal_tag> { // traversal
</s> add class Iterator { </s> add /**
* Friend all instantiations of LockedPtr and LockedPtrBase
*/
template <typename S, typename L>
friend class folly::LockedPtr;
template <typename S, typename M, typename L>
friend class LockedPtrBase;
</s> remove class Options : private boost::orable<Options> {
</s> add class Options { </s> remove FOLLY_PUSH_WARNING
FOLLY_MSVC_DISABLE_WARNING(4521) // Multiple copy constructors
FOLLY_MSVC_DISABLE_WARNING(4522) // Multiple assignment operators
</s> add </s> remove friend class Function<OtherSignature>;
</s> add friend class Function<typename Traits::OtherSignature>;
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep keep add keep keep keep keep
|
<mask> nxMoveCtor)
<mask> : datum_(std::move(rhs.datum_)) {}
<mask>
<mask> // Synchronized data members
<mask> T datum_;
<mask> mutable Mutex mutex_;
<mask> };
</s> [sdk33] Update iOS with RN 0.59 </s> remove
}
</s> add } // namespace folly </s> add /**
* Assign another datum and return the original value. Recommended
* because it keeps the mutex held only briefly.
*/
T exchange(T&& rhs) {
swap(rhs);
return std::move(rhs);
}
</s> remove explicit SharedProxy(Function<ReturnType(Args...)>&& func)
: sp_(std::make_shared<Function<ReturnType(Args...)>>(
std::move(func))) {}
</s> add explicit SharedProxy(Function<NonConstSignature>&& func)
: sp_(std::make_shared<Function<NonConstSignature>>(std::move(func))) {} </s> remove class Transformer : public boost::iterator_adaptor<
Transformer<T, It>,
It,
typename T::value_type
> {
</s> add class Transformer
: public boost::
iterator_adaptor<Transformer<T, It>, It, typename T::value_type> { </s> remove explicit SharedProxy(Function<ReturnType(Args...) const>&& func)
: sp_(std::make_shared<Function<ReturnType(Args...) const>>(
std::move(func))) {}
</s> add explicit SharedProxy(Function<NonConstSignature>&& func)
: sp_(std::make_shared<Function<NonConstSignature>>(std::move(func))) {} </s> remove public:
explicit Transformer(const It& it)
: Transformer::iterator_adaptor_(it), valid_(false) {}
</s> add public:
explicit Transformer(const It& it) : Transformer::iterator_adaptor_(it) {}
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> using LockedPtrType = typename std::conditional<
<mask> std::is_const<SynchronizedType>::value,
<mask> typename SynchronizedType::ConstLockedPtr,
<mask> typename SynchronizedType::LockedPtr>::type;
<mask> } // detail
<mask>
<mask> /**
<mask> * A helper base class for implementing LockedPtr.
<mask> *
<mask> * The main reason for having this as a separate class is so we can specialize
</s> [sdk33] Update iOS with RN 0.59 </s> add /**
* Friend all instantiations of LockedPtr and LockedPtrBase
*/
template <typename S, typename L>
friend class folly::LockedPtr;
template <typename S, typename M, typename L>
friend class LockedPtrBase;
</s> remove * \note `typename = ResultOf<Fun>` prevents this overload from being
* selected by overload resolution when `fun` is not a compatible function.
</s> add * \note `typename = decltype(Function(std::declval<Fun>()))` prevents this
* overload from being selected by overload resolution when `fun` is not a
* compatible function. </s> remove FOLLY_PACK_PUSH
template<class Value,
std::size_t RequestedMaxInline = 1,
class PolicyA = void,
class PolicyB = void,
class PolicyC = void>
class small_vector
: public detail::small_vector_base<
Value,RequestedMaxInline,PolicyA,PolicyB,PolicyC
>::type
{
typedef typename detail::small_vector_base<
Value,RequestedMaxInline,PolicyA,PolicyB,PolicyC
>::type BaseType;
</s> add FOLLY_SV_PACK_PUSH
template <
class Value,
std::size_t RequestedMaxInline = 1,
class PolicyA = void,
class PolicyB = void,
class PolicyC = void>
class small_vector : public detail::small_vector_base<
Value,
RequestedMaxInline,
PolicyA,
PolicyB,
PolicyC>::type {
typedef typename detail::
small_vector_base<Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC>::
type BaseType; </s> remove * It is non-movable, and supports fewer features than LockedPtr. However, it
* is ever-so-slightly more performant than LockedPtr. (The destructor can
* unconditionally release the lock, without requiring a conditional branch.)
</s> add * lock(wlock(one), rlock(two), wlock(three));
* synchronized([](auto one, two) { ... }, wlock(one), rlock(two)); </s> remove template <class SynchronizedType, class LockPolicy>
class LockedGuardPtr {
private:
// CDataType is the DataType with the appropriate const-qualification
using CDataType = detail::SynchronizedDataType<SynchronizedType>;
public:
using DataType = typename SynchronizedType::DataType;
using MutexType = typename SynchronizedType::MutexType;
using Synchronized = typename std::remove_const<SynchronizedType>::type;
LockedGuardPtr() = delete;
/**
* Takes a Synchronized<T> and locks it.
*/
explicit LockedGuardPtr(SynchronizedType* parent) : parent_(parent) {
LockPolicy::lock(parent_->mutex_);
}
/**
* Destructor releases.
*/
~LockedGuardPtr() {
LockPolicy::unlock(parent_->mutex_);
}
/**
* Access the locked data.
*/
CDataType* operator->() const {
return &parent_->datum_;
}
</s> add template <typename D, typename M, typename... Args>
auto wlock(Synchronized<D, M>& synchronized, Args&&... args) {
return detail::wlock(synchronized, std::forward<Args>(args)...);
}
template <typename Data, typename Mutex, typename... Args>
auto rlock(const Synchronized<Data, Mutex>& synchronized, Args&&... args) {
return detail::rlock(synchronized, std::forward<Args>(args)...);
}
template <typename D, typename M, typename... Args>
auto ulock(Synchronized<D, M>& synchronized, Args&&... args) {
return detail::ulock(synchronized, std::forward<Args>(args)...);
}
template <typename D, typename M, typename... Args>
auto lock(Synchronized<D, M>& synchronized, Args&&... args) {
return detail::lock(synchronized, std::forward<Args>(args)...);
}
template <typename D, typename M, typename... Args>
auto lock(const Synchronized<D, M>& synchronized, Args&&... args) {
return detail::lock(synchronized, std::forward<Args>(args)...);
} </s> remove #include <boost/type_traits.hpp>
#include <boost/mpl/has_xxx.hpp>
</s> add #define FOLLY_CREATE_HAS_MEMBER_TYPE_TRAITS(classname, type_name) \
template <typename TTheClass_> \
struct classname##__folly_traits_impl__ { \
template <typename UTheClass_> \
static constexpr bool test(typename UTheClass_::type_name*) { \
return true; \
} \
template <typename> \
static constexpr bool test(...) { \
return false; \
} \
}; \
template <typename TTheClass_> \
using classname = typename std::conditional< \
classname##__folly_traits_impl__<TTheClass_>::template test<TTheClass_>( \
nullptr), \
std::true_type, \
std::false_type>::type
#define FOLLY_CREATE_HAS_MEMBER_FN_TRAITS_IMPL(classname, func_name, cv_qual) \
template <typename TTheClass_, typename RTheReturn_, typename... TTheArgs_> \
struct classname##__folly_traits_impl__< \
TTheClass_, \
RTheReturn_(TTheArgs_...) cv_qual> { \
template < \
typename UTheClass_, \
RTheReturn_ (UTheClass_::*)(TTheArgs_...) cv_qual> \
struct sfinae {}; \
template <typename UTheClass_> \
static std::true_type test(sfinae<UTheClass_, &UTheClass_::func_name>*); \
template <typename> \
static std::false_type test(...); \
}
/*
* The FOLLY_CREATE_HAS_MEMBER_FN_TRAITS is used to create traits
* classes that check for the existence of a member function with
* a given name and signature. It currently does not support
* checking for inherited members.
*
* Such classes receive two template parameters: the class to be checked
* and the signature of the member function. A static boolean field
* named `value` (which is also constexpr) tells whether such member
* function exists.
*
* Each traits class created is bound only to the member name, not to
* its signature nor to the type of the class containing it.
*
* Say you need to know if a given class has a member function named
* `test` with the following signature:
*
* int test() const;
*
* You'd need this macro to create a traits class to check for a member
* named `test`, and then use this traits class to check for the signature:
*
* namespace {
*
* FOLLY_CREATE_HAS_MEMBER_FN_TRAITS(has_test_traits, test);
*
* } // unnamed-namespace
*
* void some_func() {
* cout << "Does class Foo have a member int test() const? "
* << boolalpha << has_test_traits<Foo, int() const>::value;
* }
*
* You can use the same traits class to test for a completely different
* signature, on a completely different class, as long as the member name
* is the same:
*
* void some_func() {
* cout << "Does class Foo have a member int test()? "
* << boolalpha << has_test_traits<Foo, int()>::value;
* cout << "Does class Foo have a member int test() const? "
* << boolalpha << has_test_traits<Foo, int() const>::value;
* cout << "Does class Bar have a member double test(const string&, long)? "
* << boolalpha << has_test_traits<Bar, double(const string&, long)>::value;
* }
*
* @author: Marcelo Juchem <[email protected]>
*/
#define FOLLY_CREATE_HAS_MEMBER_FN_TRAITS(classname, func_name) \
template <typename, typename> \
struct classname##__folly_traits_impl__; \
FOLLY_CREATE_HAS_MEMBER_FN_TRAITS_IMPL(classname, func_name, ); \
FOLLY_CREATE_HAS_MEMBER_FN_TRAITS_IMPL(classname, func_name, const); \
FOLLY_CREATE_HAS_MEMBER_FN_TRAITS_IMPL( \
classname, func_name, /* nolint */ volatile); \
FOLLY_CREATE_HAS_MEMBER_FN_TRAITS_IMPL( \
classname, func_name, /* nolint */ volatile const); \
template <typename TTheClass_, typename TTheSignature_> \
using classname = \
decltype(classname##__folly_traits_impl__<TTheClass_, TTheSignature_>:: \
template test<TTheClass_>(nullptr))
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep keep add keep keep keep keep
|
<mask> using MutexType = Mutex;
<mask> friend class folly::ScopedUnlocker<SynchronizedType, LockPolicy>;
<mask>
<mask> /**
<mask> * Destructor releases.
<mask> */
<mask> ~LockedPtrBase() {
</s> [sdk33] Update iOS with RN 0.59 </s> add /**
* Friend all instantiations of LockedPtr and LockedPtrBase
*/
template <typename S, typename L>
friend class folly::LockedPtr;
template <typename S, typename M, typename L>
friend class LockedPtrBase;
</s> add // Enable only if the unlock policy of the other LockPolicy is the same as
// ours
template <typename LockPolicyOther>
using EnableIfSameUnlockPolicy = std::enable_if_t<std::is_same<
typename LockPolicy::UnlockPolicy,
typename LockPolicyOther::UnlockPolicy>::value>;
// friend other LockedPtr types
template <typename SynchronizedTypeOther, typename LockPolicyOther>
friend class LockedPtr; </s> add // used to disable copy construction and assignment
class NonImplementedType;
</s> remove template <class SynchronizedType, class LockPolicy>
class LockedGuardPtr {
private:
// CDataType is the DataType with the appropriate const-qualification
using CDataType = detail::SynchronizedDataType<SynchronizedType>;
public:
using DataType = typename SynchronizedType::DataType;
using MutexType = typename SynchronizedType::MutexType;
using Synchronized = typename std::remove_const<SynchronizedType>::type;
LockedGuardPtr() = delete;
/**
* Takes a Synchronized<T> and locks it.
*/
explicit LockedGuardPtr(SynchronizedType* parent) : parent_(parent) {
LockPolicy::lock(parent_->mutex_);
}
/**
* Destructor releases.
*/
~LockedGuardPtr() {
LockPolicy::unlock(parent_->mutex_);
}
/**
* Access the locked data.
*/
CDataType* operator->() const {
return &parent_->datum_;
}
</s> add template <typename D, typename M, typename... Args>
auto wlock(Synchronized<D, M>& synchronized, Args&&... args) {
return detail::wlock(synchronized, std::forward<Args>(args)...);
}
template <typename Data, typename Mutex, typename... Args>
auto rlock(const Synchronized<Data, Mutex>& synchronized, Args&&... args) {
return detail::rlock(synchronized, std::forward<Args>(args)...);
}
template <typename D, typename M, typename... Args>
auto ulock(Synchronized<D, M>& synchronized, Args&&... args) {
return detail::ulock(synchronized, std::forward<Args>(args)...);
}
template <typename D, typename M, typename... Args>
auto lock(Synchronized<D, M>& synchronized, Args&&... args) {
return detail::lock(synchronized, std::forward<Args>(args)...);
}
template <typename D, typename M, typename... Args>
auto lock(const Synchronized<D, M>& synchronized, Args&&... args) {
return detail::lock(synchronized, std::forward<Args>(args)...);
} </s> remove friend class Function<OtherSignature>;
</s> add friend class Function<typename Traits::OtherSignature>; </s> remove class Options : private boost::orable<Options> {
</s> add class Options {
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep keep keep keep replace keep keep keep keep keep
|
<mask>
<mask> protected:
<mask> LockedPtrBase() {}
<mask> explicit LockedPtrBase(SynchronizedType* parent) : parent_(parent) {
<mask> LockPolicy::lock(parent_->mutex_);
<mask> }
<mask> template <class Rep, class Period>
<mask> LockedPtrBase(
<mask> SynchronizedType* parent,
<mask> const std::chrono::duration<Rep, Period>& timeout) {
</s> [sdk33] Update iOS with RN 0.59 </s> remove : lock_(parent->mutex_), parent_(parent) {}
</s> add : lock_{parent->mutex_, std::adopt_lock}, parent_{parent} {
DCHECK(parent);
if (!LockPolicy::lock(parent_->mutex_)) {
parent_ = nullptr;
lock_.release();
}
} </s> remove constexpr ThreadLocal() : constructor_([]() {
return new T();
}) {}
</s> add constexpr ThreadLocal() : constructor_([]() { return new T(); }) {} </s> remove template <class SynchronizedType, class LockPolicy>
class LockedGuardPtr {
private:
// CDataType is the DataType with the appropriate const-qualification
using CDataType = detail::SynchronizedDataType<SynchronizedType>;
public:
using DataType = typename SynchronizedType::DataType;
using MutexType = typename SynchronizedType::MutexType;
using Synchronized = typename std::remove_const<SynchronizedType>::type;
LockedGuardPtr() = delete;
/**
* Takes a Synchronized<T> and locks it.
*/
explicit LockedGuardPtr(SynchronizedType* parent) : parent_(parent) {
LockPolicy::lock(parent_->mutex_);
}
/**
* Destructor releases.
*/
~LockedGuardPtr() {
LockPolicy::unlock(parent_->mutex_);
}
/**
* Access the locked data.
*/
CDataType* operator->() const {
return &parent_->datum_;
}
</s> add template <typename D, typename M, typename... Args>
auto wlock(Synchronized<D, M>& synchronized, Args&&... args) {
return detail::wlock(synchronized, std::forward<Args>(args)...);
}
template <typename Data, typename Mutex, typename... Args>
auto rlock(const Synchronized<Data, Mutex>& synchronized, Args&&... args) {
return detail::rlock(synchronized, std::forward<Args>(args)...);
}
template <typename D, typename M, typename... Args>
auto ulock(Synchronized<D, M>& synchronized, Args&&... args) {
return detail::ulock(synchronized, std::forward<Args>(args)...);
}
template <typename D, typename M, typename... Args>
auto lock(Synchronized<D, M>& synchronized, Args&&... args) {
return detail::lock(synchronized, std::forward<Args>(args)...);
}
template <typename D, typename M, typename... Args>
auto lock(const Synchronized<D, M>& synchronized, Args&&... args) {
return detail::lock(synchronized, std::forward<Args>(args)...);
} </s> remove template<class SizeType, bool ShouldUseHeap>
struct IntegralSizePolicy {
typedef SizeType InternalSizeType;
IntegralSizePolicy() : size_(0) {}
protected:
static constexpr std::size_t policyMaxSize() {
return SizeType(~kExternMask);
}
std::size_t doSize() const {
return size_ & ~kExternMask;
}
std::size_t isExtern() const {
return kExternMask & size_;
}
void setExtern(bool b) {
if (b) {
size_ |= kExternMask;
} else {
size_ &= ~kExternMask;
}
}
void setSize(std::size_t sz) {
assert(sz <= policyMaxSize());
size_ = (kExternMask & size_) | SizeType(sz);
}
void swapSizePolicy(IntegralSizePolicy& o) {
std::swap(size_, o.size_);
}
protected:
static bool const kShouldUseHeap = ShouldUseHeap;
private:
static SizeType const kExternMask =
kShouldUseHeap ? SizeType(1) << (sizeof(SizeType) * 8 - 1)
: 0;
</s> add template <class SizeType>
struct IntegralSizePolicy<SizeType, false>
: public IntegralSizePolicyBase<SizeType, false> {
public:
template <class T>
void moveToUninitialized(T* /*first*/, T* /*last*/, T* /*out*/) {
assume_unreachable();
}
template <class T, class EmplaceFunc>
void moveToUninitializedEmplace(
T* /* begin */,
T* /* end */,
T* /* out */,
SizeType /* pos */,
EmplaceFunc&& /* emplaceFunc */) {
assume_unreachable();
}
}; </s> remove : impl_(std::forward<Args>(args)...) {}
CachelinePadded() {}
</s> add : inner_(std::forward<Args>(args)...) {} </s> remove /*
* Note: C++ 17 adds guaranteed copy elision. (http://wg21.link/P0135)
* Once compilers support this, it would be nice to add guard() methods that
* return LockedGuardPtr objects.
*/
</s> add
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep replace replace replace keep replace replace replace keep keep
|
<mask> }
<mask> LockedPtrBase(LockedPtrBase&& rhs) noexcept : parent_(rhs.parent_) {
<mask> rhs.parent_ = nullptr;
<mask> }
<mask> LockedPtrBase& operator=(LockedPtrBase&& rhs) noexcept {
<mask> if (parent_) {
<mask> LockPolicy::unlock(parent_->mutex_);
<mask> }
<mask>
<mask> parent_ = rhs.parent_;
</s> [sdk33] Update iOS with RN 0.59 </s> remove : lock_(std::move(rhs.lock_)), parent_(rhs.parent_) {
rhs.parent_ = nullptr;
}
</s> add : lock_{std::move(rhs.lock_)}, parent_{exchange(rhs.parent_, nullptr)} {} </s> remove lock_ = std::move(rhs.lock_);
parent_ = rhs.parent_;
rhs.parent_ = nullptr;
</s> add assignImpl(*this, rhs); </s> remove parent_ = rhs.parent_;
rhs.parent_ = nullptr;
</s> add /**
* Templated move construct and assignment operators
*
* These allow converting LockedPtr types that have the same unlocking
* policy to each other. This allows us to write code like
*
* auto wlock = sync.wlock();
* wlock.unlock();
*
* auto ulock = sync.ulock();
* wlock = ulock.moveFromUpgradeToWrite();
*/
template <typename LockPolicyType>
LockedPtrBase(
LockedPtrBase<SynchronizedType, Mutex, LockPolicyType>&& rhs) noexcept
: parent_{exchange(rhs.parent_, nullptr)} {}
template <typename LockPolicyType>
LockedPtrBase& operator=(
LockedPtrBase<SynchronizedType, Mutex, LockPolicyType>&& rhs) noexcept {
assignImpl(*this, rhs); </s> remove BenchmarkSuspender(const BenchmarkSuspender &) = delete;
BenchmarkSuspender(BenchmarkSuspender && rhs) noexcept {
</s> add BenchmarkSuspender(const BenchmarkSuspender&) = delete;
BenchmarkSuspender(BenchmarkSuspender&& rhs) noexcept { </s> remove FOLLY_POP_WARNING
</s> add
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask> if (parent_) {
<mask> LockPolicy::unlock(parent_->mutex_);
<mask> }
<mask>
<mask> parent_ = rhs.parent_;
<mask> rhs.parent_ = nullptr;
<mask> return *this;
<mask> }
<mask>
<mask> using UnlockerData = SynchronizedType*;
<mask>
</s> [sdk33] Update iOS with RN 0.59 </s> remove if (parent_) {
LockPolicy::unlock(parent_->mutex_);
}
</s> add assignImpl(*this, rhs);
return *this;
} </s> remove lock_ = std::move(rhs.lock_);
parent_ = rhs.parent_;
rhs.parent_ = nullptr;
</s> add assignImpl(*this, rhs); </s> remove : lock_(std::move(rhs.lock_)), parent_(rhs.parent_) {
rhs.parent_ = nullptr;
}
</s> add : lock_{std::move(rhs.lock_)}, parent_{exchange(rhs.parent_, nullptr)} {} </s> remove LockedPtrBase(LockedPtrBase&& rhs) noexcept : parent_(rhs.parent_) {
rhs.parent_ = nullptr;
}
</s> add LockedPtrBase(LockedPtrBase&& rhs) noexcept
: parent_{exchange(rhs.parent_, nullptr)} {} </s> remove : lock_(parent->mutex_), parent_(parent) {}
</s> add : lock_{parent->mutex_, std::adopt_lock}, parent_{parent} {
DCHECK(parent);
if (!LockPolicy::lock(parent_->mutex_)) {
parent_ = nullptr;
lock_.release();
}
} </s> add /**
* Implementation for the assignment operator
*/
template <typename LockPolicyLhs, typename LockPolicyRhs>
void assignImpl(
LockedPtrBase<SynchronizedType, Mutex, LockPolicyLhs>& lhs,
LockedPtrBase<SynchronizedType, Mutex, LockPolicyRhs>& rhs) noexcept {
if (lhs.parent_) {
LockPolicy::unlock(lhs.parent_->mutex_);
}
lhs.parent_ = exchange(rhs.parent_, nullptr);
}
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep add keep keep keep keep
|
<mask> }
<mask>
<mask> using UnlockerData = SynchronizedType*;
<mask>
<mask> /**
<mask> * Get a pointer to the Synchronized object from the UnlockerData.
</s> [sdk33] Update iOS with RN 0.59 </s> remove parent_ = rhs.parent_;
rhs.parent_ = nullptr;
</s> add /**
* Templated move construct and assignment operators
*
* These allow converting LockedPtr types that have the same unlocking
* policy to each other. This allows us to write code like
*
* auto wlock = sync.wlock();
* wlock.unlock();
*
* auto ulock = sync.ulock();
* wlock = ulock.moveFromUpgradeToWrite();
*/
template <typename LockPolicyType>
LockedPtrBase(
LockedPtrBase<SynchronizedType, Mutex, LockPolicyType>&& rhs) noexcept
: parent_{exchange(rhs.parent_, nullptr)} {}
template <typename LockPolicyType>
LockedPtrBase& operator=(
LockedPtrBase<SynchronizedType, Mutex, LockPolicyType>&& rhs) noexcept {
assignImpl(*this, rhs); </s> remove lock_ = std::move(rhs.lock_);
parent_ = rhs.parent_;
rhs.parent_ = nullptr;
</s> add assignImpl(*this, rhs); </s> remove template <typename Fun>
/* implicit */ FunctionRef(Fun&& fun) noexcept {
using ReferencedType = typename std::remove_reference<Fun>::type;
static_assert(
std::is_convertible<
typename std::result_of<ReferencedType&(Args && ...)>::type,
ReturnType>::value,
"FunctionRef cannot be constructed from object with "
"incompatible function signature");
// `Fun` may be a const type, in which case we have to do a const_cast
// to store the address in a `void*`. This is safe because the `void*`
// will be cast back to `Fun*` (which is a const pointer whenever `Fun`
// is a const type) inside `FunctionRef::call`
object_ = const_cast<void*>(static_cast<void const*>(std::addressof(fun)));
call_ = &FunctionRef::call<ReferencedType>;
}
</s> add template <
typename Fun,
typename std::enable_if<
Conjunction<
Negation<std::is_same<FunctionRef, _t<std::decay<Fun>>>>,
is_invocable_r<ReturnType, Fun&&, Args&&...>>::value,
int>::type = 0>
constexpr /* implicit */ FunctionRef(Fun&& fun) noexcept
// `Fun` may be a const type, in which case we have to do a const_cast
// to store the address in a `void*`. This is safe because the `void*`
// will be cast back to `Fun*` (which is a const pointer whenever `Fun`
// is a const type) inside `FunctionRef::call`
: object_(
const_cast<void*>(static_cast<void const*>(std::addressof(fun)))),
call_(&FunctionRef::call<Fun>) {} </s> add // Enable only if the unlock policy of the other LockPolicy is the same as
// ours
template <typename LockPolicyOther>
using EnableIfSameUnlockPolicy = std::enable_if_t<std::is_same<
typename LockPolicy::UnlockPolicy,
typename LockPolicyOther::UnlockPolicy>::value>;
// friend other LockedPtr types
template <typename SynchronizedTypeOther, typename LockPolicyOther>
friend class LockedPtr; </s> remove fbstring class_name() const {
if (item_) {
auto& i = *item_;
return demangle(typeid(i));
} else if (eptr_) {
return ename_;
} else {
return fbstring();
}
}
</s> add template <class Fn>
struct arg_type_;
template <class Fn>
using arg_type = _t<arg_type_<Fn>>;
// exception_wrapper is implemented as a simple variant over four
// different representations:
// 0. Empty, no exception.
// 1. An small object stored in-situ.
// 2. A larger object stored on the heap and referenced with a
// std::shared_ptr.
// 3. A std::exception_ptr, together with either:
// a. A pointer to the referenced std::exception object, or
// b. A pointer to a std::type_info object for the referenced exception,
// or for an unspecified type if the type is unknown.
// This is accomplished with the help of a union and a pointer to a hand-
// rolled virtual table. This virtual table contains pointers to functions
// that know which field of the union is active and do the proper action.
// The class invariant ensures that the vtable ptr and the union stay in sync.
struct VTable {
void (*copy_)(exception_wrapper const*, exception_wrapper*);
void (*move_)(exception_wrapper*, exception_wrapper*);
void (*delete_)(exception_wrapper*);
void (*throw_)(exception_wrapper const*);
std::type_info const* (*type_)(exception_wrapper const*);
std::exception const* (*get_exception_)(exception_wrapper const*);
exception_wrapper (*get_exception_ptr_)(exception_wrapper const*);
}; </s> remove * Constructs a new `Function` from any callable object. This
* handles function pointers, pointers to static member functions,
* `std::reference_wrapper` objects, `std::function` objects, and arbitrary
* objects that implement `operator()` if the parameter signature
* matches (i.e. it returns R when called with Args...).
* For a `Function` with a const function type, the object must be
* callable from a const-reference, i.e. implement `operator() const`.
* For a `Function` with a non-const function type, the object will
* be called from a non-const reference, which means that it will execute
* a non-const `operator()` if it is defined, and falls back to
* `operator() const` otherwise.
</s> add * Constructs a new `Function` from any callable object that is _not_ a
* `folly::Function`. This handles function pointers, pointers to static
* member functions, `std::reference_wrapper` objects, `std::function`
* objects, and arbitrary objects that implement `operator()` if the parameter
* signature matches (i.e. it returns an object convertible to `R` when called
* with `Args...`).
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep keep keep add keep keep keep keep keep keep
|
<mask> public:
<mask> using MutexType = std::mutex;
<mask> friend class folly::ScopedUnlocker<SynchronizedType, LockPolicy>;
<mask>
<mask> /**
<mask> * Destructor releases.
<mask> */
<mask> ~LockedPtrBase() {
<mask> // The std::unique_lock will automatically release the lock when it is
<mask> // destroyed, so we don't need to do anything extra here.
</s> [sdk33] Update iOS with RN 0.59 </s> add /**
* Friend all instantiations of LockedPtr and LockedPtrBase
*/
template <typename S, typename L>
friend class folly::LockedPtr;
template <typename S, typename M, typename L>
friend class LockedPtrBase;
</s> remove : lock_(std::move(rhs.lock_)), parent_(rhs.parent_) {
rhs.parent_ = nullptr;
}
</s> add : lock_{std::move(rhs.lock_)}, parent_{exchange(rhs.parent_, nullptr)} {} </s> add // Enable only if the unlock policy of the other LockPolicy is the same as
// ours
template <typename LockPolicyOther>
using EnableIfSameUnlockPolicy = std::enable_if_t<std::is_same<
typename LockPolicy::UnlockPolicy,
typename LockPolicyOther::UnlockPolicy>::value>;
// friend other LockedPtr types
template <typename SynchronizedTypeOther, typename LockPolicyOther>
friend class LockedPtr; </s> remove class Options : private boost::orable<Options> {
</s> add class Options { </s> remove template <class SynchronizedType, class LockPolicy>
class LockedGuardPtr {
private:
// CDataType is the DataType with the appropriate const-qualification
using CDataType = detail::SynchronizedDataType<SynchronizedType>;
public:
using DataType = typename SynchronizedType::DataType;
using MutexType = typename SynchronizedType::MutexType;
using Synchronized = typename std::remove_const<SynchronizedType>::type;
LockedGuardPtr() = delete;
/**
* Takes a Synchronized<T> and locks it.
*/
explicit LockedGuardPtr(SynchronizedType* parent) : parent_(parent) {
LockPolicy::lock(parent_->mutex_);
}
/**
* Destructor releases.
*/
~LockedGuardPtr() {
LockPolicy::unlock(parent_->mutex_);
}
/**
* Access the locked data.
*/
CDataType* operator->() const {
return &parent_->datum_;
}
</s> add template <typename D, typename M, typename... Args>
auto wlock(Synchronized<D, M>& synchronized, Args&&... args) {
return detail::wlock(synchronized, std::forward<Args>(args)...);
}
template <typename Data, typename Mutex, typename... Args>
auto rlock(const Synchronized<Data, Mutex>& synchronized, Args&&... args) {
return detail::rlock(synchronized, std::forward<Args>(args)...);
}
template <typename D, typename M, typename... Args>
auto ulock(Synchronized<D, M>& synchronized, Args&&... args) {
return detail::ulock(synchronized, std::forward<Args>(args)...);
}
template <typename D, typename M, typename... Args>
auto lock(Synchronized<D, M>& synchronized, Args&&... args) {
return detail::lock(synchronized, std::forward<Args>(args)...);
}
template <typename D, typename M, typename... Args>
auto lock(const Synchronized<D, M>& synchronized, Args&&... args) {
return detail::lock(synchronized, std::forward<Args>(args)...);
} </s> remove FOLLY_DEPRECATED("Replaced by try_get")
static std::weak_ptr<T> get_weak() { return getEntry().get_weak(); }
</s> add [[deprecated("Replaced by try_get")]] static std::weak_ptr<T> get_weak() {
return getEntry().get_weak();
}
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep keep replace replace replace keep replace replace replace keep keep keep
|
<mask>
<mask> LockedPtrBase(LockedPtrBase&& rhs) noexcept
<mask> : lock_(std::move(rhs.lock_)), parent_(rhs.parent_) {
<mask> rhs.parent_ = nullptr;
<mask> }
<mask> LockedPtrBase& operator=(LockedPtrBase&& rhs) noexcept {
<mask> lock_ = std::move(rhs.lock_);
<mask> parent_ = rhs.parent_;
<mask> rhs.parent_ = nullptr;
<mask> return *this;
<mask> }
<mask>
</s> [sdk33] Update iOS with RN 0.59 </s> remove if (parent_) {
LockPolicy::unlock(parent_->mutex_);
}
</s> add assignImpl(*this, rhs);
return *this;
} </s> remove LockedPtrBase(LockedPtrBase&& rhs) noexcept : parent_(rhs.parent_) {
rhs.parent_ = nullptr;
}
</s> add LockedPtrBase(LockedPtrBase&& rhs) noexcept
: parent_{exchange(rhs.parent_, nullptr)} {} </s> remove parent_ = rhs.parent_;
rhs.parent_ = nullptr;
</s> add /**
* Templated move construct and assignment operators
*
* These allow converting LockedPtr types that have the same unlocking
* policy to each other. This allows us to write code like
*
* auto wlock = sync.wlock();
* wlock.unlock();
*
* auto ulock = sync.ulock();
* wlock = ulock.moveFromUpgradeToWrite();
*/
template <typename LockPolicyType>
LockedPtrBase(
LockedPtrBase<SynchronizedType, Mutex, LockPolicyType>&& rhs) noexcept
: parent_{exchange(rhs.parent_, nullptr)} {}
template <typename LockPolicyType>
LockedPtrBase& operator=(
LockedPtrBase<SynchronizedType, Mutex, LockPolicyType>&& rhs) noexcept {
assignImpl(*this, rhs); </s> add template <
typename LockPolicyType,
EnableIfSameUnlockPolicy<LockPolicyType>* = nullptr>
LockedPtr& operator=(
LockedPtr<SynchronizedType, LockPolicyType>&& other) noexcept {
Base::operator=(std::move(other));
return *this;
} </s> remove BenchmarkSuspender(const BenchmarkSuspender &) = delete;
BenchmarkSuspender(BenchmarkSuspender && rhs) noexcept {
</s> add BenchmarkSuspender(const BenchmarkSuspender&) = delete;
BenchmarkSuspender(BenchmarkSuspender&& rhs) noexcept {
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep keep keep keep replace keep keep keep keep keep
|
<mask>
<mask> protected:
<mask> LockedPtrBase() {}
<mask> explicit LockedPtrBase(SynchronizedType* parent)
<mask> : lock_(parent->mutex_), parent_(parent) {}
<mask>
<mask> using UnlockerData =
<mask> std::pair<std::unique_lock<std::mutex>, SynchronizedType*>;
<mask>
<mask> static SynchronizedType* getSynchronized(const UnlockerData& data) {
</s> [sdk33] Update iOS with RN 0.59 </s> remove LockPolicy::lock(parent_->mutex_);
</s> add DCHECK(parent);
if (!LockPolicy::lock(parent_->mutex_)) {
parent_ = nullptr;
} </s> remove : impl_(std::forward<Args>(args)...) {}
CachelinePadded() {}
</s> add : inner_(std::forward<Args>(args)...) {} </s> remove explicit SharedProxy(Function<ReturnType(Args...)>&& func)
: sp_(std::make_shared<Function<ReturnType(Args...)>>(
std::move(func))) {}
</s> add explicit SharedProxy(Function<NonConstSignature>&& func)
: sp_(std::make_shared<Function<NonConstSignature>>(std::move(func))) {} </s> remove class BadFormatArg : public std::invalid_argument {
public:
explicit BadFormatArg(const std::string& msg)
: std::invalid_argument(msg) {}
</s> add class FOLLY_EXPORT BadFormatArg : public std::invalid_argument {
using invalid_argument::invalid_argument; </s> remove explicit SharedProxy(Function<ReturnType(Args...) const>&& func)
: sp_(std::make_shared<Function<ReturnType(Args...) const>>(
std::move(func))) {}
</s> add explicit SharedProxy(Function<NonConstSignature>&& func)
: sp_(std::make_shared<Function<NonConstSignature>>(std::move(func))) {} </s> remove explicit ProcessReturnCode(int rv) : rawStatus_(rv) { }
</s> add explicit ProcessReturnCode(int rv) : rawStatus_(rv) {}
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep keep keep keep replace replace replace keep keep keep keep keep
|
<mask> : ptr_(p), data_(ptr_->releaseLock()) {}
<mask> ScopedUnlocker(const ScopedUnlocker&) = delete;
<mask> ScopedUnlocker& operator=(const ScopedUnlocker&) = delete;
<mask> ScopedUnlocker(ScopedUnlocker&& other) noexcept
<mask> : ptr_(other.ptr_), data_(std::move(other.data_)) {
<mask> other.ptr_ = nullptr;
<mask> }
<mask> ScopedUnlocker& operator=(ScopedUnlocker&& other) = delete;
<mask>
<mask> ~ScopedUnlocker() {
<mask> if (ptr_) {
<mask> ptr_->reacquireLock(std::move(data_));
</s> [sdk33] Update iOS with RN 0.59 </s> add template <
typename LockPolicyType,
EnableIfSameUnlockPolicy<LockPolicyType>* = nullptr>
LockedPtr& operator=(
LockedPtr<SynchronizedType, LockPolicyType>&& other) noexcept {
Base::operator=(std::move(other));
return *this;
} </s> remove BenchmarkSuspender(const BenchmarkSuspender &) = delete;
BenchmarkSuspender(BenchmarkSuspender && rhs) noexcept {
</s> add BenchmarkSuspender(const BenchmarkSuspender&) = delete;
BenchmarkSuspender(BenchmarkSuspender&& rhs) noexcept { </s> remove : ti_(other.ti_), tag_ti_(other.tag_ti_) {
}
</s> add : ti_(other.ti_), tag_ti_(other.tag_ti_) {} </s> remove ThreadLocalPtr(ThreadLocalPtr&& other) noexcept :
id_(std::move(other.id_)) {
}
</s> add ThreadLocalPtr(ThreadLocalPtr&& other) noexcept : id_(std::move(other.id_)) {} </s> remove rhs.start.tv_nsec = rhs.start.tv_sec = 0;
</s> add rhs.start = {}; </s> remove exec_(Op::NUKE, &data_, nullptr);
</s> add exec(Op::NUKE, &data_, nullptr);
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep keep keep add keep keep keep keep keep keep
|
<mask> LockPolicy>;
<mask> using UnlockerData = typename Base::UnlockerData;
<mask> // CDataType is the DataType with the appropriate const-qualification
<mask> using CDataType = detail::SynchronizedDataType<SynchronizedType>;
<mask>
<mask> public:
<mask> using DataType = typename SynchronizedType::DataType;
<mask> using MutexType = typename SynchronizedType::MutexType;
<mask> using Synchronized = typename std::remove_const<SynchronizedType>::type;
<mask> friend class ScopedUnlocker<SynchronizedType, LockPolicy>;
</s> [sdk33] Update iOS with RN 0.59 </s> remove template <class SynchronizedType, class LockPolicy>
class LockedGuardPtr {
private:
// CDataType is the DataType with the appropriate const-qualification
using CDataType = detail::SynchronizedDataType<SynchronizedType>;
public:
using DataType = typename SynchronizedType::DataType;
using MutexType = typename SynchronizedType::MutexType;
using Synchronized = typename std::remove_const<SynchronizedType>::type;
LockedGuardPtr() = delete;
/**
* Takes a Synchronized<T> and locks it.
*/
explicit LockedGuardPtr(SynchronizedType* parent) : parent_(parent) {
LockPolicy::lock(parent_->mutex_);
}
/**
* Destructor releases.
*/
~LockedGuardPtr() {
LockPolicy::unlock(parent_->mutex_);
}
/**
* Access the locked data.
*/
CDataType* operator->() const {
return &parent_->datum_;
}
</s> add template <typename D, typename M, typename... Args>
auto wlock(Synchronized<D, M>& synchronized, Args&&... args) {
return detail::wlock(synchronized, std::forward<Args>(args)...);
}
template <typename Data, typename Mutex, typename... Args>
auto rlock(const Synchronized<Data, Mutex>& synchronized, Args&&... args) {
return detail::rlock(synchronized, std::forward<Args>(args)...);
}
template <typename D, typename M, typename... Args>
auto ulock(Synchronized<D, M>& synchronized, Args&&... args) {
return detail::ulock(synchronized, std::forward<Args>(args)...);
}
template <typename D, typename M, typename... Args>
auto lock(Synchronized<D, M>& synchronized, Args&&... args) {
return detail::lock(synchronized, std::forward<Args>(args)...);
}
template <typename D, typename M, typename... Args>
auto lock(const Synchronized<D, M>& synchronized, Args&&... args) {
return detail::lock(synchronized, std::forward<Args>(args)...);
} </s> add // used to disable copy construction and assignment
class NonImplementedType;
</s> add /**
* Friend all instantiations of LockedPtr and LockedPtrBase
*/
template <typename S, typename L>
friend class folly::LockedPtr;
template <typename S, typename M, typename L>
friend class LockedPtrBase;
</s> add /**
* Friend all instantiations of LockedPtr and LockedPtrBase
*/
template <typename S, typename L>
friend class folly::LockedPtr;
template <typename S, typename M, typename L>
friend class LockedPtrBase;
</s> remove template <typename F, typename G = typename std::decay<F>::type>
using ResultOf = decltype(
static_cast<ReturnType>(std::declval<G&>()(std::declval<Args>()...)));
</s> add template <typename F>
using ResultOf =
SafeResultOf<CallableResult<_t<std::decay<F>>&, Args...>, ReturnType>; </s> remove template <typename F, typename G = typename std::decay<F>::type>
using ResultOf = decltype(static_cast<ReturnType>(
std::declval<const G&>()(std::declval<Args>()...)));
</s> add template <typename F>
using ResultOf = SafeResultOf<
CallableResult<const _t<std::decay<F>>&, Args...>,
ReturnType>;
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep add keep keep keep keep keep keep
|
<mask> */
<mask> LockedPtr(LockedPtr&& rhs) noexcept = default;
<mask>
<mask> /**
<mask> * Move assignment operator.
<mask> */
<mask> LockedPtr& operator=(LockedPtr&& rhs) noexcept = default;
<mask> template <
</s> [sdk33] Update iOS with RN 0.59 </s> add template <
typename LockPolicyType,
EnableIfSameUnlockPolicy<LockPolicyType>* = nullptr>
LockedPtr& operator=(
LockedPtr<SynchronizedType, LockPolicyType>&& other) noexcept {
Base::operator=(std::move(other));
return *this;
} </s> remove ParameterizedTokenBucket(const ParameterizedTokenBucket& other) noexcept =
default;
</s> add BasicTokenBucket(const BasicTokenBucket& other) noexcept = default; </s> remove ParameterizedTokenBucket& operator=(
const ParameterizedTokenBucket& other) noexcept = default;
</s> add BasicTokenBucket& operator=(const BasicTokenBucket& other) noexcept = default;
/**
* Returns the current time in seconds since Epoch.
*/
static double defaultClockNow() noexcept(noexcept(Impl::defaultClockNow())) {
return Impl::defaultClockNow();
} </s> add /**
* Implementation for the assignment operator
*/
template <typename LockPolicyLhs, typename LockPolicyRhs>
void assignImpl(
LockedPtrBase<SynchronizedType, Mutex, LockPolicyLhs>& lhs,
LockedPtrBase<SynchronizedType, Mutex, LockPolicyRhs>& rhs) noexcept {
if (lhs.parent_) {
LockPolicy::unlock(lhs.parent_->mutex_);
}
lhs.parent_ = exchange(rhs.parent_, nullptr);
}
</s> remove parent_ = rhs.parent_;
rhs.parent_ = nullptr;
</s> add /**
* Templated move construct and assignment operators
*
* These allow converting LockedPtr types that have the same unlocking
* policy to each other. This allows us to write code like
*
* auto wlock = sync.wlock();
* wlock.unlock();
*
* auto ulock = sync.ulock();
* wlock = ulock.moveFromUpgradeToWrite();
*/
template <typename LockPolicyType>
LockedPtrBase(
LockedPtrBase<SynchronizedType, Mutex, LockPolicyType>&& rhs) noexcept
: parent_{exchange(rhs.parent_, nullptr)} {}
template <typename LockPolicyType>
LockedPtrBase& operator=(
LockedPtrBase<SynchronizedType, Mutex, LockPolicyType>&& rhs) noexcept {
assignImpl(*this, rhs); </s> remove LockedPtrBase(LockedPtrBase&& rhs) noexcept : parent_(rhs.parent_) {
rhs.parent_ = nullptr;
}
</s> add LockedPtrBase(LockedPtrBase&& rhs) noexcept
: parent_{exchange(rhs.parent_, nullptr)} {}
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep add keep keep keep keep keep keep
|
<mask> */
<mask> LockedPtr& operator=(LockedPtr&& rhs) noexcept = default;
<mask>
<mask> /*
<mask> * Copy constructor and assignment operator are deleted.
<mask> */
<mask> LockedPtr(const LockedPtr& rhs) = delete;
<mask> LockedPtr& operator=(const LockedPtr& rhs) = delete;
</s> [sdk33] Update iOS with RN 0.59 </s> add template <
typename LockPolicyType,
EnableIfSameUnlockPolicy<LockPolicyType>* = nullptr>
LockedPtr(LockedPtr<SynchronizedType, LockPolicyType>&& other) noexcept
: Base{std::move(other)} {} </s> remove BenchmarkSuspender(const BenchmarkSuspender &) = delete;
BenchmarkSuspender(BenchmarkSuspender && rhs) noexcept {
</s> add BenchmarkSuspender(const BenchmarkSuspender&) = delete;
BenchmarkSuspender(BenchmarkSuspender&& rhs) noexcept { </s> remove rhs.start.tv_nsec = rhs.start.tv_sec = 0;
</s> add rhs.start = {}; </s> remove Function& operator=(Function&) = delete;
</s> add </s> remove BenchmarkSuspender& operator=(const BenchmarkSuspender &) = delete;
BenchmarkSuspender& operator=(BenchmarkSuspender && rhs) {
if (start.tv_nsec > 0 || start.tv_sec > 0) {
</s> add BenchmarkSuspender& operator=(const BenchmarkSuspender&) = delete;
BenchmarkSuspender& operator=(BenchmarkSuspender&& rhs) {
if (start != TimePoint{}) { </s> remove * Copy constructor copies the data (with locking the source and
* all) but does NOT copy the mutex. Doing so would result in
* deadlocks.
</s> add * Copy constructor; deprecated
*
* Enabled only when the data type is copy-constructible.
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep keep keep keep replace replace keep replace keep keep
|
<mask> typename = typename std::enable_if<
<mask> LockTraits<typename SyncType::MutexType>::is_upgrade>::type>
<mask> LockedPtr<SynchronizedType, LockPolicyFromUpgradeToExclusive>
<mask> moveFromUpgradeToWrite() {
<mask> auto* parent_to_pass_on = this->parent_;
<mask> this->parent_ = nullptr;
<mask> return LockedPtr<SynchronizedType, LockPolicyFromUpgradeToExclusive>(
<mask> parent_to_pass_on);
<mask> }
<mask>
</s> [sdk33] Update iOS with RN 0.59 </s> remove auto* parent_to_pass_on = this->parent_;
this->parent_ = nullptr;
</s> add </s> remove auto* parent_to_pass_on = this->parent_;
this->parent_ = nullptr;
</s> add </s> remove auto* parent_to_pass_on = this->parent_;
this->parent_ = nullptr;
</s> add </s> remove parent_to_pass_on);
</s> add exchange(this->parent_, nullptr)); </s> remove parent_to_pass_on);
</s> add exchange(this->parent_, nullptr));
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep keep keep replace replace keep replace
|
<mask> LockTraits<typename SyncType::MutexType>::is_upgrade>::type>
<mask> LockedPtr<SynchronizedType, LockPolicyFromExclusiveToUpgrade>
<mask> moveFromWriteToUpgrade() {
<mask> auto* parent_to_pass_on = this->parent_;
<mask> this->parent_ = nullptr;
<mask> return LockedPtr<SynchronizedType, LockPolicyFromExclusiveToUpgrade>(
<mask> parent_to_pass_on);
</s> [sdk33] Update iOS with RN 0.59 </s> remove auto* parent_to_pass_on = this->parent_;
this->parent_ = nullptr;
</s> add </s> remove auto* parent_to_pass_on = this->parent_;
this->parent_ = nullptr;
</s> add </s> remove auto* parent_to_pass_on = this->parent_;
this->parent_ = nullptr;
</s> add </s> remove parent_to_pass_on);
</s> add exchange(this->parent_, nullptr)); </s> remove parent_to_pass_on);
</s> add exchange(this->parent_, nullptr));
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep keep keep keep replace replace keep replace keep keep keep
|
<mask> typename = typename std::enable_if<
<mask> LockTraits<typename SyncType::MutexType>::is_upgrade>::type>
<mask> LockedPtr<SynchronizedType, LockPolicyFromUpgradeToShared>
<mask> moveFromUpgradeToRead() {
<mask> auto* parent_to_pass_on = this->parent_;
<mask> this->parent_ = nullptr;
<mask> return LockedPtr<SynchronizedType, LockPolicyFromUpgradeToShared>(
<mask> parent_to_pass_on);
<mask> }
<mask>
<mask> /**
</s> [sdk33] Update iOS with RN 0.59 </s> remove auto* parent_to_pass_on = this->parent_;
this->parent_ = nullptr;
</s> add </s> remove auto* parent_to_pass_on = this->parent_;
this->parent_ = nullptr;
</s> add </s> remove auto* parent_to_pass_on = this->parent_;
this->parent_ = nullptr;
</s> add </s> remove parent_to_pass_on);
</s> add exchange(this->parent_, nullptr)); </s> remove parent_to_pass_on);
</s> add exchange(this->parent_, nullptr));
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep replace replace keep replace keep keep
|
<mask> moveFromWriteToRead() {
<mask> auto* parent_to_pass_on = this->parent_;
<mask> this->parent_ = nullptr;
<mask> return LockedPtr<SynchronizedType, LockPolicyFromExclusiveToShared>(
<mask> parent_to_pass_on);
<mask> }
<mask> };
</s> [sdk33] Update iOS with RN 0.59 </s> remove auto* parent_to_pass_on = this->parent_;
this->parent_ = nullptr;
</s> add </s> remove auto* parent_to_pass_on = this->parent_;
this->parent_ = nullptr;
</s> add </s> remove auto* parent_to_pass_on = this->parent_;
this->parent_ = nullptr;
</s> add </s> remove parent_to_pass_on);
</s> add exchange(this->parent_, nullptr)); </s> remove parent_to_pass_on);
</s> add exchange(this->parent_, nullptr));
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep keep keep keep replace keep replace replace replace keep keep keep keep
|
<mask> }
<mask> };
<mask>
<mask> /**
<mask> * LockedGuardPtr is a simplified version of LockedPtr.
<mask> *
<mask> * It is non-movable, and supports fewer features than LockedPtr. However, it
<mask> * is ever-so-slightly more performant than LockedPtr. (The destructor can
<mask> * unconditionally release the lock, without requiring a conditional branch.)
<mask> *
<mask> * The relationship between LockedGuardPtr and LockedPtr is similar to that
<mask> * between std::lock_guard and std::unique_lock.
<mask> */
</s> [sdk33] Update iOS with RN 0.59 </s> remove * The relationship between LockedGuardPtr and LockedPtr is similar to that
* between std::lock_guard and std::unique_lock.
</s> add * For example in the above rlock() produces an implementation defined read
* locking helper instance and wlock() a write locking helper
*
* Subsequent arguments passed to these locking helpers, after the first, will
* be passed by const-ref to the corresponding function on the synchronized
* instance. This means that if the function accepts these parameters by
* value, they will be copied. Note that it is not necessary that the primary
* locking function will be invoked at all (for eg. the implementation might
* just invoke the try*Lock() method)
*
* // Try to acquire the lock for one second
* synchronized([](auto) { ... }, wlock(one, 1s));
*
* // The timed lock acquire might never actually be called, if it is not
* // needed by the underlying deadlock avoiding algorithm
* synchronized([](auto, auto) { ... }, rlock(one), wlock(two, 1s));
*
* Note that the arguments passed to to *lock() calls will be passed by
* const-ref to the function invocation, as the implementation might use them
* many times </s> remove parent_to_pass_on);
</s> add exchange(this->parent_, nullptr)); </s> remove template <class SynchronizedType, class LockPolicy>
class LockedGuardPtr {
private:
// CDataType is the DataType with the appropriate const-qualification
using CDataType = detail::SynchronizedDataType<SynchronizedType>;
public:
using DataType = typename SynchronizedType::DataType;
using MutexType = typename SynchronizedType::MutexType;
using Synchronized = typename std::remove_const<SynchronizedType>::type;
LockedGuardPtr() = delete;
/**
* Takes a Synchronized<T> and locks it.
*/
explicit LockedGuardPtr(SynchronizedType* parent) : parent_(parent) {
LockPolicy::lock(parent_->mutex_);
}
/**
* Destructor releases.
*/
~LockedGuardPtr() {
LockPolicy::unlock(parent_->mutex_);
}
/**
* Access the locked data.
*/
CDataType* operator->() const {
return &parent_->datum_;
}
</s> add template <typename D, typename M, typename... Args>
auto wlock(Synchronized<D, M>& synchronized, Args&&... args) {
return detail::wlock(synchronized, std::forward<Args>(args)...);
}
template <typename Data, typename Mutex, typename... Args>
auto rlock(const Synchronized<Data, Mutex>& synchronized, Args&&... args) {
return detail::rlock(synchronized, std::forward<Args>(args)...);
}
template <typename D, typename M, typename... Args>
auto ulock(Synchronized<D, M>& synchronized, Args&&... args) {
return detail::ulock(synchronized, std::forward<Args>(args)...);
}
template <typename D, typename M, typename... Args>
auto lock(Synchronized<D, M>& synchronized, Args&&... args) {
return detail::lock(synchronized, std::forward<Args>(args)...);
}
template <typename D, typename M, typename... Args>
auto lock(const Synchronized<D, M>& synchronized, Args&&... args) {
return detail::lock(synchronized, std::forward<Args>(args)...);
} </s> remove /*
</s> add /** </s> remove * acquisition is unsuccessful, the returned LockedPtr is NULL.
</s> add * acquisition is unsuccessful, the returned LockedPtr is nullptr.
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep keep replace replace keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace
|
<mask> * unconditionally release the lock, without requiring a conditional branch.)
<mask> *
<mask> * The relationship between LockedGuardPtr and LockedPtr is similar to that
<mask> * between std::lock_guard and std::unique_lock.
<mask> */
<mask> template <class SynchronizedType, class LockPolicy>
<mask> class LockedGuardPtr {
<mask> private:
<mask> // CDataType is the DataType with the appropriate const-qualification
<mask> using CDataType = detail::SynchronizedDataType<SynchronizedType>;
<mask>
<mask> public:
<mask> using DataType = typename SynchronizedType::DataType;
<mask> using MutexType = typename SynchronizedType::MutexType;
<mask> using Synchronized = typename std::remove_const<SynchronizedType>::type;
<mask>
<mask> LockedGuardPtr() = delete;
<mask>
<mask> /**
<mask> * Takes a Synchronized<T> and locks it.
<mask> */
<mask> explicit LockedGuardPtr(SynchronizedType* parent) : parent_(parent) {
<mask> LockPolicy::lock(parent_->mutex_);
<mask> }
<mask>
<mask> /**
<mask> * Destructor releases.
<mask> */
<mask> ~LockedGuardPtr() {
<mask> LockPolicy::unlock(parent_->mutex_);
<mask> }
<mask>
<mask> /**
<mask> * Access the locked data.
<mask> */
<mask> CDataType* operator->() const {
<mask> return &parent_->datum_;
<mask> }
</s> [sdk33] Update iOS with RN 0.59 </s> remove * It is non-movable, and supports fewer features than LockedPtr. However, it
* is ever-so-slightly more performant than LockedPtr. (The destructor can
* unconditionally release the lock, without requiring a conditional branch.)
</s> add * lock(wlock(one), rlock(two), wlock(three));
* synchronized([](auto one, two) { ... }, wlock(one), rlock(two)); </s> add // Enable only if the unlock policy of the other LockPolicy is the same as
// ours
template <typename LockPolicyOther>
using EnableIfSameUnlockPolicy = std::enable_if_t<std::is_same<
typename LockPolicy::UnlockPolicy,
typename LockPolicyOther::UnlockPolicy>::value>;
// friend other LockedPtr types
template <typename SynchronizedTypeOther, typename LockPolicyOther>
friend class LockedPtr; </s> add /**
* Friend all instantiations of LockedPtr and LockedPtrBase
*/
template <typename S, typename L>
friend class folly::LockedPtr;
template <typename S, typename M, typename L>
friend class LockedPtrBase;
</s> add /**
* Friend all instantiations of LockedPtr and LockedPtrBase
*/
template <typename S, typename L>
friend class folly::LockedPtr;
template <typename S, typename M, typename L>
friend class LockedPtrBase;
</s> remove /**
* Access the locked data.
*/
CDataType& operator*() const {
return parent_->datum_;
}
</s> add /**
* Acquire locks for multiple Synchronized<> objects, in a deadlock-safe
* manner.
*
* Wrap the synchronized instances with the appropriate locking strategy by
* using one of the four strategies - folly::lock (exclusive acquire for
* exclusive only mutexes), folly::rlock (shared acquire for shareable
* mutexes), folly::wlock (exclusive acquire for shareable mutexes) or
* folly::ulock (upgrade acquire for upgrade mutexes) (see above)
*
* The locks will be acquired and the passed callable will be invoked with the
* LockedPtr instances in the order that they were passed to the function
*/
template <typename Func, typename... SynchronizedLockers>
decltype(auto) synchronized(Func&& func, SynchronizedLockers&&... lockers) {
return apply(
std::forward<Func>(func),
lock(std::forward<SynchronizedLockers>(lockers)...));
}
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep replace replace replace replace replace replace keep replace replace replace replace keep keep
|
<mask>
<mask> /**
<mask> * Access the locked data.
<mask> */
<mask> CDataType& operator*() const {
<mask> return parent_->datum_;
<mask> }
<mask>
<mask> private:
<mask> // This is the entire state of LockedGuardPtr.
<mask> SynchronizedType* const parent_{nullptr};
<mask> };
<mask>
<mask> /**
</s> [sdk33] Update iOS with RN 0.59 </s> remove template <class SynchronizedType, class LockPolicy>
class LockedGuardPtr {
private:
// CDataType is the DataType with the appropriate const-qualification
using CDataType = detail::SynchronizedDataType<SynchronizedType>;
public:
using DataType = typename SynchronizedType::DataType;
using MutexType = typename SynchronizedType::MutexType;
using Synchronized = typename std::remove_const<SynchronizedType>::type;
LockedGuardPtr() = delete;
/**
* Takes a Synchronized<T> and locks it.
*/
explicit LockedGuardPtr(SynchronizedType* parent) : parent_(parent) {
LockPolicy::lock(parent_->mutex_);
}
/**
* Destructor releases.
*/
~LockedGuardPtr() {
LockPolicy::unlock(parent_->mutex_);
}
/**
* Access the locked data.
*/
CDataType* operator->() const {
return &parent_->datum_;
}
</s> add template <typename D, typename M, typename... Args>
auto wlock(Synchronized<D, M>& synchronized, Args&&... args) {
return detail::wlock(synchronized, std::forward<Args>(args)...);
}
template <typename Data, typename Mutex, typename... Args>
auto rlock(const Synchronized<Data, Mutex>& synchronized, Args&&... args) {
return detail::rlock(synchronized, std::forward<Args>(args)...);
}
template <typename D, typename M, typename... Args>
auto ulock(Synchronized<D, M>& synchronized, Args&&... args) {
return detail::ulock(synchronized, std::forward<Args>(args)...);
}
template <typename D, typename M, typename... Args>
auto lock(Synchronized<D, M>& synchronized, Args&&... args) {
return detail::lock(synchronized, std::forward<Args>(args)...);
}
template <typename D, typename M, typename... Args>
auto lock(const Synchronized<D, M>& synchronized, Args&&... args) {
return detail::lock(synchronized, std::forward<Args>(args)...);
} </s> remove std::string what_;
</s> add </s> remove parent_to_pass_on);
</s> add exchange(this->parent_, nullptr)); </s> remove parent_to_pass_on);
</s> add exchange(this->parent_, nullptr)); </s> remove parent_to_pass_on);
</s> add exchange(this->parent_, nullptr));
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> * manner.
<mask> *
<mask> * The locks are acquired in order from lowest address to highest address.
<mask> * (Note that this is not necessarily the same algorithm used by std::lock().)
<mask> *
<mask> * For parameters that are const and support shared locks, a read lock is
<mask> * acquired. Otherwise an exclusive lock is acquired.
<mask> *
<mask> * TODO: Extend acquireLocked() with variadic template versions that
<mask> * allow for more than 2 Synchronized arguments. (I haven't given too much
</s> [sdk33] Update iOS with RN 0.59 </s> remove * TODO: Extend acquireLocked() with variadic template versions that
* allow for more than 2 Synchronized arguments. (I haven't given too much
* thought about how to implement this. It seems like it would be rather
* complicated, but I think it should be possible.)
</s> add * use lock() with folly::wlock(), folly::rlock() and folly::ulock() for
* arbitrary locking without causing a deadlock (as much as possible), with the
* same effects as std::lock() </s> remove private:
// This is the entire state of LockedGuardPtr.
SynchronizedType* const parent_{nullptr};
};
</s> add /**
* Acquire locks on many lockables or synchronized instances in such a way
* that the sequence of calls within the function does not cause deadlocks.
*
* This can often result in a performance boost as compared to simply
* acquiring your locks in an ordered manner. Even for very simple cases.
* The algorithm tried to adjust to contention by blocking on the mutex it
* thinks is the best fit, leaving all other mutexes open to be locked by
* other threads. See the benchmarks in folly/test/SynchronizedBenchmark.cpp
* for more
*
* This works differently as compared to the locking algorithm in libstdc++
* and is the recommended way to acquire mutexes in a generic order safe
* manner. Performance benchmarks show that this does better than the one in
* libstdc++ even for the simple cases
*
* Usage is the same as std::lock() for arbitrary lockables
*
* folly::lock(one, two, three);
*
* To make it work with folly::Synchronized you have to specify how you want
* the locks to be acquired, use the folly::wlock(), folly::rlock(),
* folly::ulock() and folly::lock() helpers defined below
*
* auto [one, two] = lock(folly::wlock(a), folly::rlock(b));
*
* Note that you can/must avoid the folly:: namespace prefix on the lock()
* function if you use the helpers, ADL lookup is done to find the lock function
*
* This will execute the deadlock avoidance algorithm and acquire a write lock
* for a and a read lock for b
*/
template <typename LockableOne, typename LockableTwo, typename... Lockables>
void lock(LockableOne& one, LockableTwo& two, Lockables&... lockables) {
auto locker = [](auto& lockable) {
using Lockable = std::remove_reference_t<decltype(lockable)>;
return detail::makeSynchronizedLocker(
lockable,
[](auto& l) { return std::unique_lock<Lockable>{l}; },
[](auto& l) {
auto lock = std::unique_lock<Lockable>{l, std::defer_lock};
lock.try_lock();
return lock;
});
};
auto locks = lock(locker(one), locker(two), locker(lockables)...);
// release ownership of the locks from the RAII lock wrapper returned by the
// function above
for_each(locks, [&](auto& lock) { lock.release(); });
} </s> remove * The relationship between LockedGuardPtr and LockedPtr is similar to that
* between std::lock_guard and std::unique_lock.
</s> add * For example in the above rlock() produces an implementation defined read
* locking helper instance and wlock() a write locking helper
*
* Subsequent arguments passed to these locking helpers, after the first, will
* be passed by const-ref to the corresponding function on the synchronized
* instance. This means that if the function accepts these parameters by
* value, they will be copied. Note that it is not necessary that the primary
* locking function will be invoked at all (for eg. the implementation might
* just invoke the try*Lock() method)
*
* // Try to acquire the lock for one second
* synchronized([](auto) { ... }, wlock(one, 1s));
*
* // The timed lock acquire might never actually be called, if it is not
* // needed by the underlying deadlock avoiding algorithm
* synchronized([](auto, auto) { ... }, rlock(one), wlock(two, 1s));
*
* Note that the arguments passed to to *lock() calls will be passed by
* const-ref to the function invocation, as the implementation might use them
* many times </s> remove * Holds a type T, in addition to enough padding to round the size up to the
* next multiple of the false sharing range used by folly.
*
* If T is standard-layout, then casting a T* you get from this class to a
* CachelinePadded<T>* is safe.
*
* This class handles padding, but imperfectly handles alignment. (Note that
* alignment matters for false-sharing: imagine a cacheline size of 64, and two
* adjacent 64-byte objects, with the first starting at an offset of 32. The
* last 32 bytes of the first object share a cacheline with the first 32 bytes
* of the second.). We alignas this class to be at least cacheline-sized, but
* it's implementation-defined what that means (since a cacheline is almost
* certainly larger than the maximum natural alignment). The following should be
* true for recent compilers on common architectures:
*
* For heap objects, alignment needs to be handled at the allocator level, such
* as with posix_memalign (this isn't necessary with jemalloc, which aligns
* objects that are a multiple of cacheline size to a cacheline).
</s> add * Holds a type T, in addition to enough padding to ensure that it isn't subject
* to false sharing within the range used by folly. </s> remove * Move assignment operator, only assigns the data, NOT the
* mutex. It locks the two objects in ascending order of their
* addresses.
</s> add * Move assignment operator; deprecated
*
* Takes an exclusive lock on the destination mutex while move-assigning the
* destination data from the source data. The source mutex is not locked or
* otherwise accessed.
*
* Semantically, assumes that the source object is a true rvalue and therefore
* that no synchronization is required for accessing it. </s> remove /**
* Sometimes, although you have a mutable object, you only want to
* call a const method against it. The most efficient way to achieve
* that is by using a read lock. You get to do so by using
* obj.asConst()->method() instead of obj->method().
*
* NOTE: This API is planned to be deprecated in an upcoming diff.
* Use rlock() instead.
*/
const Synchronized& asConst() const {
return *this;
}
</s> add
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep keep keep keep replace replace replace replace keep keep keep keep keep
|
<mask> *
<mask> * For parameters that are const and support shared locks, a read lock is
<mask> * acquired. Otherwise an exclusive lock is acquired.
<mask> *
<mask> * TODO: Extend acquireLocked() with variadic template versions that
<mask> * allow for more than 2 Synchronized arguments. (I haven't given too much
<mask> * thought about how to implement this. It seems like it would be rather
<mask> * complicated, but I think it should be possible.)
<mask> */
<mask> template <class Sync1, class Sync2>
<mask> std::tuple<detail::LockedPtrType<Sync1>, detail::LockedPtrType<Sync2>>
<mask> acquireLocked(Sync1& l1, Sync2& l2) {
<mask> if (static_cast<const void*>(&l1) < static_cast<const void*>(&l2)) {
</s> [sdk33] Update iOS with RN 0.59 </s> remove *
</s> add </s> remove * The relationship between LockedGuardPtr and LockedPtr is similar to that
* between std::lock_guard and std::unique_lock.
</s> add * For example in the above rlock() produces an implementation defined read
* locking helper instance and wlock() a write locking helper
*
* Subsequent arguments passed to these locking helpers, after the first, will
* be passed by const-ref to the corresponding function on the synchronized
* instance. This means that if the function accepts these parameters by
* value, they will be copied. Note that it is not necessary that the primary
* locking function will be invoked at all (for eg. the implementation might
* just invoke the try*Lock() method)
*
* // Try to acquire the lock for one second
* synchronized([](auto) { ... }, wlock(one, 1s));
*
* // The timed lock acquire might never actually be called, if it is not
* // needed by the underlying deadlock avoiding algorithm
* synchronized([](auto, auto) { ... }, rlock(one), wlock(two, 1s));
*
* Note that the arguments passed to to *lock() calls will be passed by
* const-ref to the function invocation, as the implementation might use them
* many times </s> remove * LockedGuardPtr is a simplified version of LockedPtr.
</s> add * Helper functions that should be passed to either a lock() or synchronized()
* invocation, these return implementation defined structs that will be used
* to lock the synchronized instance appropriately. </s> remove * Constructs a new `Function` from any callable object. This
* handles function pointers, pointers to static member functions,
* `std::reference_wrapper` objects, `std::function` objects, and arbitrary
* objects that implement `operator()` if the parameter signature
* matches (i.e. it returns R when called with Args...).
* For a `Function` with a const function type, the object must be
* callable from a const-reference, i.e. implement `operator() const`.
* For a `Function` with a non-const function type, the object will
* be called from a non-const reference, which means that it will execute
* a non-const `operator()` if it is defined, and falls back to
* `operator() const` otherwise.
</s> add * Constructs a new `Function` from any callable object that is _not_ a
* `folly::Function`. This handles function pointers, pointers to static
* member functions, `std::reference_wrapper` objects, `std::function`
* objects, and arbitrary objects that implement `operator()` if the parameter
* signature matches (i.e. it returns an object convertible to `R` when called
* with `Args...`). </s> remove * It is non-movable, and supports fewer features than LockedPtr. However, it
* is ever-so-slightly more performant than LockedPtr. (The destructor can
* unconditionally release the lock, without requiring a conditional branch.)
</s> add * lock(wlock(one), rlock(two), wlock(three));
* synchronized([](auto one, two) { ... }, wlock(one), rlock(two)); </s> remove * Holds a type T, in addition to enough padding to round the size up to the
* next multiple of the false sharing range used by folly.
*
* If T is standard-layout, then casting a T* you get from this class to a
* CachelinePadded<T>* is safe.
*
* This class handles padding, but imperfectly handles alignment. (Note that
* alignment matters for false-sharing: imagine a cacheline size of 64, and two
* adjacent 64-byte objects, with the first starting at an offset of 32. The
* last 32 bytes of the first object share a cacheline with the first 32 bytes
* of the second.). We alignas this class to be at least cacheline-sized, but
* it's implementation-defined what that means (since a cacheline is almost
* certainly larger than the maximum natural alignment). The following should be
* true for recent compilers on common architectures:
*
* For heap objects, alignment needs to be handled at the allocator level, such
* as with posix_memalign (this isn't necessary with jemalloc, which aligns
* objects that are a multiple of cacheline size to a cacheline).
</s> add * Holds a type T, in addition to enough padding to ensure that it isn't subject
* to false sharing within the range used by folly.
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep add keep keep keep keep
|
<mask> }
<mask>
<mask> /**
<mask> * SYNCHRONIZED is the main facility that makes Synchronized<T>
<mask> * helpful. It is a pseudo-statement that introduces a scope where the
<mask> * object is locked. Inside that scope you get to access the unadorned
</s> [sdk33] Update iOS with RN 0.59 </s> remove * LockedGuardPtr is a simplified version of LockedPtr.
</s> add * Helper functions that should be passed to either a lock() or synchronized()
* invocation, these return implementation defined structs that will be used
* to lock the synchronized instance appropriately. </s> remove * Move assignment operator, only assigns the data, NOT the
* mutex. It locks the two objects in ascending order of their
* addresses.
</s> add * Move assignment operator; deprecated
*
* Takes an exclusive lock on the destination mutex while move-assigning the
* destination data from the source data. The source mutex is not locked or
* otherwise accessed.
*
* Semantically, assumes that the source object is a true rvalue and therefore
* that no synchronization is required for accessing it. </s> remove // Please note, however, that all non-weak_ptr interfaces are
// inherently subject to races with destruction. Use responsibly.
</s> add // You can also access a singleton instance with
// `Singleton<ObjectType, TagType>::try_get()`. We recommend
// that you prefer the form `the_singleton.try_get()` because it ensures that
// `the_singleton` is used and cannot be garbage-collected during linking: this
// is necessary because the constructor of `the_singleton` is what registers it
// to the SingletonVault. </s> remove FOLLY_DEPRECATED("Replaced by try_get")
static std::weak_ptr<T> get_weak() { return getEntry().get_weak(); }
</s> add [[deprecated("Replaced by try_get")]] static std::weak_ptr<T> get_weak() {
return getEntry().get_weak();
} </s> remove * Note that the move constructor may throw because it acquires a lock.
* Since the move constructor is not declared noexcept, when objects of this
* class are used as elements in a vector or a similar container. The
* elements might not be moved around when resizing. They might be copied
* instead. You have been warned.
</s> add * Semantically, assumes that the source object is a true rvalue and therefore
* that no synchronization is required for accessing it. </s> remove * Holds a type T, in addition to enough padding to round the size up to the
* next multiple of the false sharing range used by folly.
*
* If T is standard-layout, then casting a T* you get from this class to a
* CachelinePadded<T>* is safe.
*
* This class handles padding, but imperfectly handles alignment. (Note that
* alignment matters for false-sharing: imagine a cacheline size of 64, and two
* adjacent 64-byte objects, with the first starting at an offset of 32. The
* last 32 bytes of the first object share a cacheline with the first 32 bytes
* of the second.). We alignas this class to be at least cacheline-sized, but
* it's implementation-defined what that means (since a cacheline is almost
* certainly larger than the maximum natural alignment). The following should be
* true for recent compilers on common architectures:
*
* For heap objects, alignment needs to be handled at the allocator level, such
* as with posix_memalign (this isn't necessary with jemalloc, which aligns
* objects that are a multiple of cacheline size to a cacheline).
</s> add * Holds a type T, in addition to enough padding to ensure that it isn't subject
* to false sharing within the range used by folly.
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep keep replace keep replace keep keep keep
|
<mask> #define SYNCHRONIZED(...) \
<mask> FOLLY_PUSH_WARNING \
<mask> FOLLY_GCC_DISABLE_WARNING(shadow) \
<mask> FOLLY_GCC_DISABLE_NEW_SHADOW_WARNINGS \
<mask> if (bool SYNCHRONIZED_state = false) { \
<mask> } else \
<mask> for (auto SYNCHRONIZED_lockedPtr = \
<mask> (FB_VA_GLUE(FB_ARG_2_OR_1, (__VA_ARGS__))).operator->(); \
</s> [sdk33] Update iOS with RN 0.59 </s> remove for (auto SYNCHRONIZED_lockedPtr = \
</s> add for (auto SYNCHRONIZED_VAR(lockedPtr) = \ </s> remove if (bool SYNCHRONIZED_state = false) { \
</s> add if (bool SYNCHRONIZED_VAR(state) = false) { \ </s> remove *SYNCHRONIZED_lockedPtr.operator->(); \
!SYNCHRONIZED_state; \
SYNCHRONIZED_state = true) \
FOLLY_POP_WARNING
</s> add *SYNCHRONIZED_VAR(lockedPtr).operator->(); \
!SYNCHRONIZED_VAR(state); \
SYNCHRONIZED_VAR(state) = true) \
FOLLY_POP_WARNING </s> remove for (auto SYNCHRONIZED_lockedPtr = \
</s> add for (auto SYNCHRONIZED_VAR(lockedPtr) = \ </s> remove !SYNCHRONIZED_state; \
SYNCHRONIZED_state = true) \
</s> add !SYNCHRONIZED_VAR(state); \
SYNCHRONIZED_VAR(state) = true) \
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep keep keep replace keep replace replace keep keep
|
<mask> FOLLY_GCC_DISABLE_NEW_SHADOW_WARNINGS \
<mask> if (bool SYNCHRONIZED_state = false) { \
<mask> } else \
<mask> for (auto SYNCHRONIZED_lockedPtr = \
<mask> (FB_VA_GLUE(FB_ARG_2_OR_1, (__VA_ARGS__))).operator->(); \
<mask> !SYNCHRONIZED_state; \
<mask> SYNCHRONIZED_state = true) \
<mask> for (auto& FB_VA_GLUE(FB_ARG_1, (__VA_ARGS__)) = \
<mask> *SYNCHRONIZED_lockedPtr.operator->(); \
</s> [sdk33] Update iOS with RN 0.59 </s> remove *SYNCHRONIZED_lockedPtr.operator->(); \
!SYNCHRONIZED_state; \
SYNCHRONIZED_state = true) \
FOLLY_POP_WARNING
</s> add *SYNCHRONIZED_VAR(lockedPtr).operator->(); \
!SYNCHRONIZED_VAR(state); \
SYNCHRONIZED_VAR(state) = true) \
FOLLY_POP_WARNING </s> remove if (bool SYNCHRONIZED_state = false) { \
</s> add if (bool SYNCHRONIZED_VAR(state) = false) { \ </s> remove !SYNCHRONIZED_state; \
SYNCHRONIZED_state = true) \
</s> add !SYNCHRONIZED_VAR(state); \
SYNCHRONIZED_VAR(state) = true) \ </s> remove for (auto SYNCHRONIZED_lockedPtr = \
</s> add for (auto SYNCHRONIZED_VAR(lockedPtr) = \ </s> remove if (bool SYNCHRONIZED_state = false) { \
</s> add if (bool SYNCHRONIZED_VAR(state) = false) { \
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep keep keep keep replace replace replace replace keep keep replace keep
|
<mask> (FB_VA_GLUE(FB_ARG_2_OR_1, (__VA_ARGS__))).operator->(); \
<mask> !SYNCHRONIZED_state; \
<mask> SYNCHRONIZED_state = true) \
<mask> for (auto& FB_VA_GLUE(FB_ARG_1, (__VA_ARGS__)) = \
<mask> *SYNCHRONIZED_lockedPtr.operator->(); \
<mask> !SYNCHRONIZED_state; \
<mask> SYNCHRONIZED_state = true) \
<mask> FOLLY_POP_WARNING
<mask>
<mask> #define TIMED_SYNCHRONIZED(timeout, ...) \
<mask> if (bool SYNCHRONIZED_state = false) { \
<mask> } else \
</s> [sdk33] Update iOS with RN 0.59 </s> remove !SYNCHRONIZED_state; \
SYNCHRONIZED_state = true) \
</s> add !SYNCHRONIZED_VAR(state); \
SYNCHRONIZED_VAR(state) = true) \ </s> remove for (auto SYNCHRONIZED_lockedPtr = \
</s> add for (auto SYNCHRONIZED_VAR(lockedPtr) = \ </s> remove for (auto SYNCHRONIZED_lockedPtr = \
</s> add for (auto SYNCHRONIZED_VAR(lockedPtr) = \ </s> remove !SYNCHRONIZED_state; \
SYNCHRONIZED_state = true) \
</s> add !SYNCHRONIZED_VAR(state); \
SYNCHRONIZED_VAR(state) = true) \ </s> remove if (bool SYNCHRONIZED_state = false) { \
</s> add if (bool SYNCHRONIZED_VAR(state) = false) { \
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep keep replace keep replace replace keep keep
|
<mask> if (bool SYNCHRONIZED_state = false) { \
<mask> } else \
<mask> for (auto SYNCHRONIZED_lockedPtr = \
<mask> (FB_VA_GLUE(FB_ARG_2_OR_1, (__VA_ARGS__))).timedAcquire(timeout); \
<mask> !SYNCHRONIZED_state; \
<mask> SYNCHRONIZED_state = true) \
<mask> for (auto FB_VA_GLUE(FB_ARG_1, (__VA_ARGS__)) = \
<mask> (!SYNCHRONIZED_lockedPtr \
</s> [sdk33] Update iOS with RN 0.59 </s> remove !SYNCHRONIZED_state; \
SYNCHRONIZED_state = true) \
</s> add !SYNCHRONIZED_VAR(state); \
SYNCHRONIZED_VAR(state) = true) \ </s> remove for (auto SYNCHRONIZED_lockedPtr = \
</s> add for (auto SYNCHRONIZED_VAR(lockedPtr) = \ </s> remove if (bool SYNCHRONIZED_state = false) { \
</s> add if (bool SYNCHRONIZED_VAR(state) = false) { \ </s> remove *SYNCHRONIZED_lockedPtr.operator->(); \
!SYNCHRONIZED_state; \
SYNCHRONIZED_state = true) \
FOLLY_POP_WARNING
</s> add *SYNCHRONIZED_VAR(lockedPtr).operator->(); \
!SYNCHRONIZED_VAR(state); \
SYNCHRONIZED_VAR(state) = true) \
FOLLY_POP_WARNING </s> remove (!SYNCHRONIZED_lockedPtr \
</s> add (!SYNCHRONIZED_VAR(lockedPtr) \
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep keep keep keep replace keep replace replace replace keep keep keep keep
|
<mask> (FB_VA_GLUE(FB_ARG_2_OR_1, (__VA_ARGS__))).timedAcquire(timeout); \
<mask> !SYNCHRONIZED_state; \
<mask> SYNCHRONIZED_state = true) \
<mask> for (auto FB_VA_GLUE(FB_ARG_1, (__VA_ARGS__)) = \
<mask> (!SYNCHRONIZED_lockedPtr \
<mask> ? nullptr \
<mask> : SYNCHRONIZED_lockedPtr.operator->()); \
<mask> !SYNCHRONIZED_state; \
<mask> SYNCHRONIZED_state = true)
<mask>
<mask> /**
<mask> * Similar to SYNCHRONIZED, but only uses a read lock.
<mask> */
</s> [sdk33] Update iOS with RN 0.59 </s> remove !SYNCHRONIZED_state; \
SYNCHRONIZED_state = true) \
</s> add !SYNCHRONIZED_VAR(state); \
SYNCHRONIZED_VAR(state) = true) \ </s> remove for (auto SYNCHRONIZED_lockedPtr = \
</s> add for (auto SYNCHRONIZED_VAR(lockedPtr) = \ </s> remove !SYNCHRONIZED_state; \
SYNCHRONIZED_state = true) \
</s> add !SYNCHRONIZED_VAR(state); \
SYNCHRONIZED_VAR(state) = true) \ </s> remove *SYNCHRONIZED_lockedPtr.operator->(); \
!SYNCHRONIZED_state; \
SYNCHRONIZED_state = true) \
FOLLY_POP_WARNING
</s> add *SYNCHRONIZED_VAR(lockedPtr).operator->(); \
!SYNCHRONIZED_VAR(state); \
SYNCHRONIZED_VAR(state) = true) \
FOLLY_POP_WARNING </s> remove for (auto SYNCHRONIZED_lockedPtr = \
</s> add for (auto SYNCHRONIZED_VAR(lockedPtr) = \
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> */
<mask> #define SYNCHRONIZED_CONST(...) \
<mask> SYNCHRONIZED( \
<mask> FB_VA_GLUE(FB_ARG_1, (__VA_ARGS__)), \
<mask> (FB_VA_GLUE(FB_ARG_2_OR_1, (__VA_ARGS__))).asConst())
<mask>
<mask> /**
<mask> * Similar to TIMED_SYNCHRONIZED, but only uses a read lock.
<mask> */
<mask> #define TIMED_SYNCHRONIZED_CONST(timeout, ...) \
</s> [sdk33] Update iOS with RN 0.59 </s> remove : SYNCHRONIZED_lockedPtr.operator->()); \
!SYNCHRONIZED_state; \
SYNCHRONIZED_state = true)
</s> add : SYNCHRONIZED_VAR(lockedPtr).operator->()); \
!SYNCHRONIZED_VAR(state); \
SYNCHRONIZED_VAR(state) = true) </s> remove #define BENCHMARK_RELATIVE_MULTI(name, ...) \
BENCHMARK_MULTI_IMPL( \
name, \
"%" FB_STRINGIZE(name), \
FB_ONE_OR_NONE(unsigned, ## __VA_ARGS__), \
__VA_ARGS__)
</s> add #define BENCHMARK_RELATIVE_MULTI(name, ...) \
BENCHMARK_MULTI_IMPL( \
name, \
"%" FB_STRINGIZE(name), \
FB_ONE_OR_NONE(unsigned, ##__VA_ARGS__), \
__VA_ARGS__) </s> remove (FB_VA_GLUE(FB_ARG_2_OR_1, (__VA_ARGS__))).asConst())
/**
* Temporarily disables synchronization inside a SYNCHRONIZED block.
*
* Note: This macro is deprecated, and kind of broken. The input parameter
* does not control what it unlocks--it always unlocks the lock acquired by the
* most recent SYNCHRONIZED scope. If you have two nested SYNCHRONIZED blocks,
* UNSYNCHRONIZED always unlocks the inner-most, even if you pass in the
* variable name used in the outer SYNCHRONIZED block.
*
* This macro will be removed soon in a subsequent diff.
*/
#define UNSYNCHRONIZED(name) \
for (auto SYNCHRONIZED_state3 = SYNCHRONIZED_lockedPtr.scopedUnlock(); \
!SYNCHRONIZED_state; \
SYNCHRONIZED_state = true) \
for (auto& name = *SYNCHRONIZED_state3.getSynchronized(); \
!SYNCHRONIZED_state; \
SYNCHRONIZED_state = true)
</s> add as_const(FB_VA_GLUE(FB_ARG_2_OR_1, (__VA_ARGS__)))) </s> remove for (auto SYNCHRONIZED_lockedPtr = \
</s> add for (auto SYNCHRONIZED_VAR(lockedPtr) = \ </s> remove #define BENCHMARK_RELATIVE_NAMED_PARAM_MULTI(name, param_name, ...) \
BENCHMARK_MULTI_IMPL( \
FB_CONCATENATE(name, FB_CONCATENATE(_, param_name)), \
"%" FB_STRINGIZE(name) "(" FB_STRINGIZE(param_name) ")", \
unsigned, \
iters) { \
return name(iters, ## __VA_ARGS__); \
</s> add #define BENCHMARK_RELATIVE_NAMED_PARAM_MULTI(name, param_name, ...) \
BENCHMARK_MULTI_IMPL( \
FB_CONCATENATE(name, FB_CONCATENATE(_, param_name)), \
"%" FB_STRINGIZE(name) "(" FB_STRINGIZE(param_name) ")", \
unsigned, \
iters) { \
return name(iters, ##__VA_ARGS__); \ </s> remove #define BENCHMARK_RELATIVE(name, ...) \
BENCHMARK_IMPL( \
name, \
"%" FB_STRINGIZE(name), \
FB_ARG_2_OR_1(1, ## __VA_ARGS__), \
FB_ONE_OR_NONE(unsigned, ## __VA_ARGS__), \
__VA_ARGS__)
</s> add #define BENCHMARK_RELATIVE(name, ...) \
BENCHMARK_IMPL( \
name, \
"%" FB_STRINGIZE(name), \
FB_ARG_2_OR_1(1, ##__VA_ARGS__), \
FB_ONE_OR_NONE(unsigned, ##__VA_ARGS__), \
__VA_ARGS__)
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
|
<mask> #define TIMED_SYNCHRONIZED_CONST(timeout, ...) \
<mask> TIMED_SYNCHRONIZED( \
<mask> timeout, \
<mask> FB_VA_GLUE(FB_ARG_1, (__VA_ARGS__)), \
<mask> (FB_VA_GLUE(FB_ARG_2_OR_1, (__VA_ARGS__))).asConst())
<mask>
<mask> /**
<mask> * Temporarily disables synchronization inside a SYNCHRONIZED block.
<mask> *
<mask> * Note: This macro is deprecated, and kind of broken. The input parameter
<mask> * does not control what it unlocks--it always unlocks the lock acquired by the
<mask> * most recent SYNCHRONIZED scope. If you have two nested SYNCHRONIZED blocks,
<mask> * UNSYNCHRONIZED always unlocks the inner-most, even if you pass in the
<mask> * variable name used in the outer SYNCHRONIZED block.
<mask> *
<mask> * This macro will be removed soon in a subsequent diff.
<mask> */
<mask> #define UNSYNCHRONIZED(name) \
<mask> for (auto SYNCHRONIZED_state3 = SYNCHRONIZED_lockedPtr.scopedUnlock(); \
<mask> !SYNCHRONIZED_state; \
<mask> SYNCHRONIZED_state = true) \
<mask> for (auto& name = *SYNCHRONIZED_state3.getSynchronized(); \
<mask> !SYNCHRONIZED_state; \
<mask> SYNCHRONIZED_state = true)
<mask>
<mask> /**
<mask> * Synchronizes two Synchronized objects (they may encapsulate
<mask> * different data). Synchronization is done in increasing address of
<mask> * object order, so there is no deadlock risk.
</s> [sdk33] Update iOS with RN 0.59 </s> remove #define SYNCHRONIZED_DUAL(n1, e1, n2, e2) \
if (bool SYNCHRONIZED_state = false) { \
} else \
for (auto SYNCHRONIZED_ptrs = acquireLockedPair(e1, e2); \
!SYNCHRONIZED_state; \
SYNCHRONIZED_state = true) \
for (auto& n1 = *SYNCHRONIZED_ptrs.first; !SYNCHRONIZED_state; \
SYNCHRONIZED_state = true) \
for (auto& n2 = *SYNCHRONIZED_ptrs.second; !SYNCHRONIZED_state; \
SYNCHRONIZED_state = true)
</s> add #define SYNCHRONIZED_DUAL(n1, e1, n2, e2) \
if (bool SYNCHRONIZED_VAR(state) = false) { \
} else \
for (auto SYNCHRONIZED_VAR(ptrs) = acquireLockedPair(e1, e2); \
!SYNCHRONIZED_VAR(state); \
SYNCHRONIZED_VAR(state) = true) \
for (auto& n1 = *SYNCHRONIZED_VAR(ptrs).first; !SYNCHRONIZED_VAR(state); \
SYNCHRONIZED_VAR(state) = true) \
for (auto& n2 = *SYNCHRONIZED_VAR(ptrs).second; \
!SYNCHRONIZED_VAR(state); \
SYNCHRONIZED_VAR(state) = true) </s> remove *SYNCHRONIZED_lockedPtr.operator->(); \
!SYNCHRONIZED_state; \
SYNCHRONIZED_state = true) \
FOLLY_POP_WARNING
</s> add *SYNCHRONIZED_VAR(lockedPtr).operator->(); \
!SYNCHRONIZED_VAR(state); \
SYNCHRONIZED_VAR(state) = true) \
FOLLY_POP_WARNING </s> remove : SYNCHRONIZED_lockedPtr.operator->()); \
!SYNCHRONIZED_state; \
SYNCHRONIZED_state = true)
</s> add : SYNCHRONIZED_VAR(lockedPtr).operator->()); \
!SYNCHRONIZED_VAR(state); \
SYNCHRONIZED_VAR(state) = true) </s> remove !SYNCHRONIZED_state; \
SYNCHRONIZED_state = true) \
</s> add !SYNCHRONIZED_VAR(state); \
SYNCHRONIZED_VAR(state) = true) \ </s> remove for (auto SYNCHRONIZED_lockedPtr = \
</s> add for (auto SYNCHRONIZED_VAR(lockedPtr) = \ </s> remove (!SYNCHRONIZED_lockedPtr \
</s> add (!SYNCHRONIZED_VAR(lockedPtr) \
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep keep keep keep replace replace replace replace replace replace replace replace replace replace keep keep
|
<mask> * Synchronizes two Synchronized objects (they may encapsulate
<mask> * different data). Synchronization is done in increasing address of
<mask> * object order, so there is no deadlock risk.
<mask> */
<mask> #define SYNCHRONIZED_DUAL(n1, e1, n2, e2) \
<mask> if (bool SYNCHRONIZED_state = false) { \
<mask> } else \
<mask> for (auto SYNCHRONIZED_ptrs = acquireLockedPair(e1, e2); \
<mask> !SYNCHRONIZED_state; \
<mask> SYNCHRONIZED_state = true) \
<mask> for (auto& n1 = *SYNCHRONIZED_ptrs.first; !SYNCHRONIZED_state; \
<mask> SYNCHRONIZED_state = true) \
<mask> for (auto& n2 = *SYNCHRONIZED_ptrs.second; !SYNCHRONIZED_state; \
<mask> SYNCHRONIZED_state = true)
<mask>
<mask> } /* namespace folly */
</s> [sdk33] Update iOS with RN 0.59 </s> remove !SYNCHRONIZED_state; \
SYNCHRONIZED_state = true) \
</s> add !SYNCHRONIZED_VAR(state); \
SYNCHRONIZED_VAR(state) = true) \ </s> remove *SYNCHRONIZED_lockedPtr.operator->(); \
!SYNCHRONIZED_state; \
SYNCHRONIZED_state = true) \
FOLLY_POP_WARNING
</s> add *SYNCHRONIZED_VAR(lockedPtr).operator->(); \
!SYNCHRONIZED_VAR(state); \
SYNCHRONIZED_VAR(state) = true) \
FOLLY_POP_WARNING </s> remove (FB_VA_GLUE(FB_ARG_2_OR_1, (__VA_ARGS__))).asConst())
/**
* Temporarily disables synchronization inside a SYNCHRONIZED block.
*
* Note: This macro is deprecated, and kind of broken. The input parameter
* does not control what it unlocks--it always unlocks the lock acquired by the
* most recent SYNCHRONIZED scope. If you have two nested SYNCHRONIZED blocks,
* UNSYNCHRONIZED always unlocks the inner-most, even if you pass in the
* variable name used in the outer SYNCHRONIZED block.
*
* This macro will be removed soon in a subsequent diff.
*/
#define UNSYNCHRONIZED(name) \
for (auto SYNCHRONIZED_state3 = SYNCHRONIZED_lockedPtr.scopedUnlock(); \
!SYNCHRONIZED_state; \
SYNCHRONIZED_state = true) \
for (auto& name = *SYNCHRONIZED_state3.getSynchronized(); \
!SYNCHRONIZED_state; \
SYNCHRONIZED_state = true)
</s> add as_const(FB_VA_GLUE(FB_ARG_2_OR_1, (__VA_ARGS__)))) </s> remove if (bool SYNCHRONIZED_state = false) { \
</s> add if (bool SYNCHRONIZED_VAR(state) = false) { \ </s> remove for (auto SYNCHRONIZED_lockedPtr = \
</s> add for (auto SYNCHRONIZED_VAR(lockedPtr) = \ </s> remove !SYNCHRONIZED_state; \
SYNCHRONIZED_state = true) \
</s> add !SYNCHRONIZED_VAR(state); \
SYNCHRONIZED_VAR(state) = true) \
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/Synchronized.h
|
keep replace keep keep keep keep keep
|
<mask> /*
<mask> * Copyright 2016 Facebook, Inc.
<mask> *
<mask> * Licensed under the Apache License, Version 2.0 (the "License");
<mask> * you may not use this file except in compliance with the License.
<mask> * You may obtain a copy of the License at
<mask> *
</s> [sdk33] Update iOS with RN 0.59
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/ThreadCachedInt.h
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> // Note that readFull requires holding a lock and iterating through all of the
<mask> // thread local objects with the same Tag, so if you have a lot of
<mask> // ThreadCachedInt's you should considering breaking up the Tag space even
<mask> // further.
<mask> template <class IntT, class Tag=IntT>
<mask> class ThreadCachedInt : boost::noncopyable {
<mask> struct IntCache;
<mask>
<mask> public:
<mask> explicit ThreadCachedInt(IntT initialVal = 0, uint32_t cacheSize = 1000)
</s> [sdk33] Update iOS with RN 0.59 </s> remove : target_(initialVal), cacheSize_(cacheSize) {
}
</s> add : target_(initialVal), cacheSize_(cacheSize) {} </s> remove static_assert(!std::is_same<Tag, void>::value,
"Must use a unique Tag to use the accessAllThreads feature");
</s> add static_assert(
!std::is_same<Tag, void>::value,
"Must use a unique Tag to use the accessAllThreads feature"); </s> remove // Basic usage of this class is very simple; suppose you have a class
</s> add // Recommended usage of this class: suppose you have a class </s> remove threadlocal_detail::ElementWrapper& w = StaticMeta::instance().get(&id_);
w.dispose(TLPDestructionMode::THIS_THREAD);
</s> add threadlocal_detail::ElementWrapper* w = &StaticMeta::get(&id_);
w->dispose(TLPDestructionMode::THIS_THREAD);
// need to get a new ptr since the
// ThreadEntry::elements array can be reallocated
w = &StaticMeta::get(&id_);
w->cleanup(); </s> remove auto accessor = cache_.accessAllThreads();
</s> add const auto accessor = cache_.accessAllThreads(); </s> remove // each must be given a unique tag. If no tag is specified - default tag is used
</s> add // each must be given a unique tag. If no tag is specified a default tag is
// used. We recommend that you use a tag from an anonymous namespace private to
// your implementation file, as this ensures that the singleton is only
// available via your interface and not also through Singleton<T>::try_get()
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/ThreadCachedInt.h
|
keep keep replace replace keep keep keep replace
|
<mask> public:
<mask> explicit ThreadCachedInt(IntT initialVal = 0, uint32_t cacheSize = 1000)
<mask> : target_(initialVal), cacheSize_(cacheSize) {
<mask> }
<mask>
<mask> void increment(IntT inc) {
<mask> auto cache = cache_.get();
<mask> if (UNLIKELY(cache == nullptr || cache->parent_ == nullptr)) {
</s> [sdk33] Update iOS with RN 0.59 </s> remove template <class IntT, class Tag=IntT>
</s> add template <class IntT, class Tag = IntT> </s> remove ThreadCachedInt& operator+=(IntT inc) { increment(inc); return *this; }
ThreadCachedInt& operator-=(IntT inc) { increment(-inc); return *this; }
</s> add ThreadCachedInt& operator+=(IntT inc) {
increment(inc);
return *this;
}
ThreadCachedInt& operator-=(IntT inc) {
increment(-inc);
return *this;
} </s> remove assert(start.tv_nsec == 0 || start.tv_sec == 0);
CHECK_EQ(0, clock_gettime(CLOCK_REALTIME, &start));
</s> add assert(start == TimePoint{});
start = Clock::now(); </s> remove explicit ThreadLocal(std::function<T*()> constructor) :
constructor_(constructor) {
}
T* get() const {
T* ptr = tlp_.get();
if (LIKELY(ptr != nullptr)) {
return ptr;
}
// separated new item creation out to speed up the fast path.
return makeTlp();
</s> add template <
typename F,
_t<std::enable_if<is_invocable_r<T*, F>::value, int>> = 0>
explicit ThreadLocal(F&& constructor)
: constructor_(std::forward<F>(constructor)) {}
FOLLY_ALWAYS_INLINE FOLLY_ATTR_VISIBILITY_HIDDEN T* get() const {
auto const ptr = tlp_.get();
return FOLLY_LIKELY(!!ptr) ? ptr : makeTlp(); </s> remove start.tv_nsec = start.tv_sec = 0;
</s> add start = {};
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/ThreadCachedInt.h
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> // a lock, so this is significantly slower than readFast().
<mask> IntT readFull() const {
<mask> // This could race with thread destruction and so the access lock should be
<mask> // acquired before reading the current value
<mask> auto accessor = cache_.accessAllThreads();
<mask> IntT ret = readFast();
<mask> for (const auto& cache : accessor) {
<mask> if (!cache.reset_.load(std::memory_order_acquire)) {
<mask> ret += cache.val_.load(std::memory_order_relaxed);
<mask> }
</s> [sdk33] Update iOS with RN 0.59 </s> remove for (const auto& p : singletons_) {
</s> add for (const auto& p : *singletons) { </s> remove RWSpinLock::ReadHolder rh(&mutex_);
</s> add auto singletons = singletons_.rlock(); </s> remove // This is a little tricky - it's possible that our IntCaches are still alive
// in another thread and will get destroyed after this destructor runs, so we
// need to make sure we signal that this parent is dead.
~ThreadCachedInt() {
for (auto& cache : cache_.accessAllThreads()) {
cache.parent_ = nullptr;
}
}
</s> add </s> remove std::pair<NodeType*, int> findNode(const value_type &data) const {
</s> add std::pair<NodeType*, int> findNode(const value_type& data) const { </s> remove std::string name() const {
auto ret = demangle(ti_.name());
if (tag_ti_ != std::type_index(typeid(DefaultTag))) {
ret += "/";
ret += demangle(tag_ti_.name());
}
return ret.toStdString();
}
</s> add std::string name() const; </s> remove if (ret.second && !ret.first->markedForRemoval()) return ret.first;
</s> add if (ret.second && !ret.first->markedForRemoval()) {
return ret.first;
}
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/ThreadCachedInt.h
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask> uint32_t getCacheSize() const {
<mask> return cacheSize_.load();
<mask> }
<mask>
<mask> ThreadCachedInt& operator+=(IntT inc) { increment(inc); return *this; }
<mask> ThreadCachedInt& operator-=(IntT inc) { increment(-inc); return *this; }
<mask> // pre-increment (we don't support post-increment)
<mask> ThreadCachedInt& operator++() { increment(1); return *this; }
<mask> ThreadCachedInt& operator--() { increment(-1); return *this; }
<mask>
<mask> // Thread-safe set function.
</s> [sdk33] Update iOS with RN 0.59 </s> remove ThreadCachedInt& operator++() { increment(1); return *this; }
ThreadCachedInt& operator--() { increment(-1); return *this; }
</s> add ThreadCachedInt& operator++() {
increment(1);
return *this;
}
ThreadCachedInt& operator--() {
increment(IntT(-1));
return *this;
} </s> remove for (; e_ != &accessor_->meta_.head_ && !valid(); e_ = e_->prev) { }
</s> add for (; e_ != &accessor_->meta_.head_.elements[accessor_->id_].node &&
!valid();
e_ = e_->getPrev()) {
}
}
public:
using difference_type = ssize_t;
using value_type = T;
using reference = T const&;
using pointer = T const*;
using iterator_category = std::bidirectional_iterator_tag;
Iterator& operator++() {
increment();
return *this;
}
Iterator& operator++(int) {
Iterator copy(*this);
increment();
return copy;
}
Iterator& operator--() {
decrement();
return *this;
}
Iterator& operator--(int) {
Iterator copy(*this);
decrement();
return copy;
}
T& operator*() {
return dereference();
}
T const& operator*() const {
return dereference();
}
T* operator->() {
return &dereference();
}
T const* operator->() const {
return &dereference();
}
bool operator==(Iterator const& rhs) const {
return equal(rhs);
}
bool operator!=(Iterator const& rhs) const {
return !equal(rhs); </s> remove if (parent_) {
LockPolicy::unlock(parent_->mutex_);
}
</s> add assignImpl(*this, rhs);
return *this;
} </s> remove const Ignore& operator=(T const&) const { return *this; }
</s> add const Ignore& operator=(T const&) const {
return *this;
} </s> remove assign(o.begin(), o.end());
</s> add if (FOLLY_LIKELY(this != &o)) {
assign(o.begin(), o.end());
} </s> remove if (start.tv_nsec > 0 || start.tv_sec > 0) {
</s> add if (start != TimePoint{}) {
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/ThreadCachedInt.h
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask>
<mask> ThreadCachedInt& operator+=(IntT inc) { increment(inc); return *this; }
<mask> ThreadCachedInt& operator-=(IntT inc) { increment(-inc); return *this; }
<mask> // pre-increment (we don't support post-increment)
<mask> ThreadCachedInt& operator++() { increment(1); return *this; }
<mask> ThreadCachedInt& operator--() { increment(-1); return *this; }
<mask>
<mask> // Thread-safe set function.
<mask> // This is a best effort implementation. In some edge cases, there could be
<mask> // data loss (missing counts)
<mask> void set(IntT newVal) {
</s> [sdk33] Update iOS with RN 0.59 </s> remove ThreadCachedInt& operator+=(IntT inc) { increment(inc); return *this; }
ThreadCachedInt& operator-=(IntT inc) { increment(-inc); return *this; }
</s> add ThreadCachedInt& operator+=(IntT inc) {
increment(inc);
return *this;
}
ThreadCachedInt& operator-=(IntT inc) {
increment(-inc);
return *this;
} </s> remove for (; e_ != &accessor_->meta_.head_ && !valid(); e_ = e_->prev) { }
</s> add for (; e_ != &accessor_->meta_.head_.elements[accessor_->id_].node &&
!valid();
e_ = e_->getPrev()) {
}
}
public:
using difference_type = ssize_t;
using value_type = T;
using reference = T const&;
using pointer = T const*;
using iterator_category = std::bidirectional_iterator_tag;
Iterator& operator++() {
increment();
return *this;
}
Iterator& operator++(int) {
Iterator copy(*this);
increment();
return copy;
}
Iterator& operator--() {
decrement();
return *this;
}
Iterator& operator--(int) {
Iterator copy(*this);
decrement();
return copy;
}
T& operator*() {
return dereference();
}
T const& operator*() const {
return dereference();
}
T* operator->() {
return &dereference();
}
T const* operator->() const {
return &dereference();
}
bool operator==(Iterator const& rhs) const {
return equal(rhs);
}
bool operator!=(Iterator const& rhs) const {
return !equal(rhs); </s> remove if (parent_) {
LockPolicy::unlock(parent_->mutex_);
}
</s> add assignImpl(*this, rhs);
return *this;
} </s> remove if (start.tv_nsec > 0 || start.tv_sec > 0) {
</s> add if (start != TimePoint{}) { </s> remove void push_back(const value_type c) { // primitive
</s> add void push_back(const value_type c) { // primitive </s> remove assign(o.begin(), o.end());
</s> add if (FOLLY_LIKELY(this != &o)) {
assign(o.begin(), o.end());
}
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/ThreadCachedInt.h
|
keep keep keep keep replace replace replace replace replace replace replace replace replace keep keep keep keep keep
|
<mask> }
<mask> target_.store(newVal, std::memory_order_release);
<mask> }
<mask>
<mask> // This is a little tricky - it's possible that our IntCaches are still alive
<mask> // in another thread and will get destroyed after this destructor runs, so we
<mask> // need to make sure we signal that this parent is dead.
<mask> ~ThreadCachedInt() {
<mask> for (auto& cache : cache_.accessAllThreads()) {
<mask> cache.parent_ = nullptr;
<mask> }
<mask> }
<mask>
<mask> private:
<mask> std::atomic<IntT> target_;
<mask> std::atomic<uint32_t> cacheSize_;
<mask> ThreadLocalPtr<IntCache, Tag, AccessModeStrict>
<mask> cache_; // Must be last for dtor ordering
</s> [sdk33] Update iOS with RN 0.59 </s> remove // We want to make sure the same stuff is uninitialized memory
// if we exit via an exception (this is to make sure we provide
// the basic exception safety guarantee for insert functions).
if (out < lastConstructed) {
out = lastConstructed - 1;
}
for (auto it = out + 1; it != realLast; ++it) {
it->~T();
}
</s> add out[pos].~T(); </s> remove val_.load(std::memory_order_relaxed) + inc,
std::memory_order_release
);
</s> add val_.load(std::memory_order_relaxed) + inc,
std::memory_order_release); </s> remove for (; in != end && out >= lastConstructed; --in, --out) {
new (out) T(std::move(*in));
}
for (; in != end; --in, --out) {
*out = std::move(*in);
}
for (; out >= lastConstructed; --out) {
new (out) T();
}
</s> add this->moveToUninitialized(begin, begin + pos, out); </s> remove FOLLY_DEPRECATED("Replaced by try_get")
static std::weak_ptr<T> get_weak() { return getEntry().get_weak(); }
</s> add [[deprecated("Replaced by try_get")]] static std::weak_ptr<T> get_weak() {
return getEntry().get_weak();
} </s> remove auto accessor = cache_.accessAllThreads();
</s> add const auto accessor = cache_.accessAllThreads(); </s> remove if (length == 0 || (result == 0.0 && std::isspace((*src)[length - 1]))) {
</s> add if (length == 0 ||
(result == 0.0 && std::isspace((*src)[size_t(length) - 1]))) {
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/ThreadCachedInt.h
|
keep keep keep keep replace replace replace keep keep keep keep keep
|
<mask> if (LIKELY(!reset_.load(std::memory_order_acquire))) {
<mask> // This thread is the only writer to val_, so it's fine do do
<mask> // a relaxed load and do the addition non-atomically.
<mask> val_.store(
<mask> val_.load(std::memory_order_relaxed) + inc,
<mask> std::memory_order_release
<mask> );
<mask> } else {
<mask> val_.store(inc, std::memory_order_relaxed);
<mask> reset_.store(false, std::memory_order_release);
<mask> }
<mask> ++numUpdates_;
</s> [sdk33] Update iOS with RN 0.59 </s> remove if (UNLIKELY(numUpdates_ >
parent_->cacheSize_.load(std::memory_order_acquire))) {
</s> add if (UNLIKELY(
numUpdates_ >
parent_->cacheSize_.load(std::memory_order_acquire))) { </s> remove FOLLY_DEPRECATED("Replaced by try_get")
static T* get() { return getEntry().get(); }
</s> add [[deprecated("Replaced by try_get")]] static T* get() {
return getEntry().get();
} </s> remove // This is a little tricky - it's possible that our IntCaches are still alive
// in another thread and will get destroyed after this destructor runs, so we
// need to make sure we signal that this parent is dead.
~ThreadCachedInt() {
for (auto& cache : cache_.accessAllThreads()) {
cache.parent_ = nullptr;
}
}
</s> add </s> remove fbstring class_name() const {
if (item_) {
auto& i = *item_;
return demangle(typeid(i));
} else if (eptr_) {
return ename_;
} else {
return fbstring();
}
}
</s> add template <class Fn>
struct arg_type_;
template <class Fn>
using arg_type = _t<arg_type_<Fn>>;
// exception_wrapper is implemented as a simple variant over four
// different representations:
// 0. Empty, no exception.
// 1. An small object stored in-situ.
// 2. A larger object stored on the heap and referenced with a
// std::shared_ptr.
// 3. A std::exception_ptr, together with either:
// a. A pointer to the referenced std::exception object, or
// b. A pointer to a std::type_info object for the referenced exception,
// or for an unspecified type if the type is unknown.
// This is accomplished with the help of a union and a pointer to a hand-
// rolled virtual table. This virtual table contains pointers to functions
// that know which field of the union is active and do the proper action.
// The class invariant ensures that the vtable ptr and the union stay in sync.
struct VTable {
void (*copy_)(exception_wrapper const*, exception_wrapper*);
void (*move_)(exception_wrapper*, exception_wrapper*);
void (*delete_)(exception_wrapper*);
void (*throw_)(exception_wrapper const*);
std::type_info const* (*type_)(exception_wrapper const*);
std::exception const* (*get_exception_)(exception_wrapper const*);
exception_wrapper (*get_exception_ptr_)(exception_wrapper const*);
}; </s> remove FOLLY_DEPRECATED("Replaced by try_get")
static std::weak_ptr<T> get_weak() { return getEntry().get_weak(); }
</s> add [[deprecated("Replaced by try_get")]] static std::weak_ptr<T> get_weak() {
return getEntry().get_weak();
} </s> remove if (std::is_same<categ,std::input_iterator_tag>::value) {
</s> add if (std::is_same<categ, std::input_iterator_tag>::value) {
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/ThreadCachedInt.h
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask> val_.store(inc, std::memory_order_relaxed);
<mask> reset_.store(false, std::memory_order_release);
<mask> }
<mask> ++numUpdates_;
<mask> if (UNLIKELY(numUpdates_ >
<mask> parent_->cacheSize_.load(std::memory_order_acquire))) {
<mask> flush();
<mask> }
<mask> }
<mask>
<mask> void flush() const {
</s> [sdk33] Update iOS with RN 0.59 </s> remove val_.load(std::memory_order_relaxed) + inc,
std::memory_order_release
);
</s> add val_.load(std::memory_order_relaxed) + inc,
std::memory_order_release); </s> remove if (parent_) {
flush();
}
</s> add flush(); </s> remove nodes_.reset(new std::vector<NodeType*>(1, node));
</s> add nodes_ = std::make_unique<std::vector<NodeType*>>(1, node); </s> remove if (start.tv_nsec > 0 || start.tv_sec > 0) {
</s> add if (start != TimePoint{}) { </s> remove NodeAlloc& alloc() { return alloc_; }
</s> add NodeAlloc& alloc() {
return alloc_;
} </s> remove value_type& data() { return data_; }
const value_type& data() const { return data_; }
int maxLayer() const { return height_ - 1; }
int height() const { return height_; }
</s> add value_type& data() {
return data_;
}
const value_type& data() const {
return data_;
}
int maxLayer() const {
return height_ - 1;
}
int height() const {
return height_;
}
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/ThreadCachedInt.h
|
keep keep keep keep replace replace replace keep keep keep keep replace
|
<mask> numUpdates_ = 0;
<mask> }
<mask>
<mask> ~IntCache() {
<mask> if (parent_) {
<mask> flush();
<mask> }
<mask> }
<mask> };
<mask> };
<mask>
<mask> }
</s> [sdk33] Update iOS with RN 0.59
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/ThreadCachedInt.h
|
keep replace keep keep keep keep keep
|
<mask> /*
<mask> * Copyright 2016 Facebook, Inc.
<mask> *
<mask> * Licensed under the Apache License, Version 2.0 (the "License");
<mask> * you may not use this file except in compliance with the License.
<mask> * You may obtain a copy of the License at
<mask> *
</s> [sdk33] Update iOS with RN 0.59
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/ThreadLocal.h
|
keep keep replace keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep
|
<mask> #pragma once
<mask>
<mask> #include <boost/iterator/iterator_facade.hpp>
<mask> #include <folly/Likely.h>
<mask> #include <folly/Portability.h>
<mask> #include <folly/ScopeGuard.h>
<mask> #include <folly/SharedMutex.h>
<mask> #include <type_traits>
<mask> #include <utility>
<mask>
<mask> namespace folly {
<mask> enum class TLPDestructionMode {
<mask> THIS_THREAD,
<mask> ALL_THREADS
<mask> };
<mask> struct AccessModeStrict {};
<mask> } // namespace
<mask>
<mask> #include <folly/detail/ThreadLocalDetail.h>
<mask>
<mask> namespace folly {
<mask>
</s> [sdk33] Update iOS with RN 0.59 </s> add #include <folly/CPortability.h>
</s> add #include <folly/lang/Exception.h> </s> add #include <folly/Traits.h>
#include <folly/functional/Invoke.h>
#include <folly/lang/Exception.h> </s> remove #include <boost/operators.hpp>
#include <folly/portability/BitsFunctexcept.h>
</s> add #include <folly/Traits.h>
#include <folly/Utility.h>
#include <folly/lang/Exception.h> </s> remove #include <string>
</s> add
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/ThreadLocal.h
|
keep keep keep keep replace replace replace keep replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep
|
<mask>
<mask> template <class T, class Tag = void, class AccessMode = void>
<mask> class ThreadLocal {
<mask> public:
<mask> constexpr ThreadLocal() : constructor_([]() {
<mask> return new T();
<mask> }) {}
<mask>
<mask> explicit ThreadLocal(std::function<T*()> constructor) :
<mask> constructor_(constructor) {
<mask> }
<mask>
<mask> T* get() const {
<mask> T* ptr = tlp_.get();
<mask> if (LIKELY(ptr != nullptr)) {
<mask> return ptr;
<mask> }
<mask>
<mask> // separated new item creation out to speed up the fast path.
<mask> return makeTlp();
<mask> }
<mask>
<mask> T* operator->() const {
<mask> return get();
</s> [sdk33] Update iOS with RN 0.59 </s> remove return &impl_.item;
</s> add return &inner_; </s> remove threadlocal_detail::ElementWrapper& w = StaticMeta::instance().get(&id_);
</s> add threadlocal_detail::ElementWrapper& w = StaticMeta::get(&id_); </s> remove : impl_(std::forward<Args>(args)...) {}
CachelinePadded() {}
</s> add : inner_(std::forward<Args>(args)...) {} </s> remove template<class SizeType, bool ShouldUseHeap>
struct IntegralSizePolicy {
typedef SizeType InternalSizeType;
IntegralSizePolicy() : size_(0) {}
protected:
static constexpr std::size_t policyMaxSize() {
return SizeType(~kExternMask);
}
std::size_t doSize() const {
return size_ & ~kExternMask;
}
std::size_t isExtern() const {
return kExternMask & size_;
}
void setExtern(bool b) {
if (b) {
size_ |= kExternMask;
} else {
size_ &= ~kExternMask;
}
}
void setSize(std::size_t sz) {
assert(sz <= policyMaxSize());
size_ = (kExternMask & size_) | SizeType(sz);
}
void swapSizePolicy(IntegralSizePolicy& o) {
std::swap(size_, o.size_);
}
protected:
static bool const kShouldUseHeap = ShouldUseHeap;
private:
static SizeType const kExternMask =
kShouldUseHeap ? SizeType(1) << (sizeof(SizeType) * 8 - 1)
: 0;
</s> add template <class SizeType>
struct IntegralSizePolicy<SizeType, false>
: public IntegralSizePolicyBase<SizeType, false> {
public:
template <class T>
void moveToUninitialized(T* /*first*/, T* /*last*/, T* /*out*/) {
assume_unreachable();
}
template <class T, class EmplaceFunc>
void moveToUninitializedEmplace(
T* /* begin */,
T* /* end */,
T* /* out */,
SizeType /* pos */,
EmplaceFunc&& /* emplaceFunc */) {
assume_unreachable();
}
}; </s> remove return &impl_.item;
</s> add return &inner_;
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/ThreadLocal.h
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask> // non-copyable
<mask> ThreadLocal(const ThreadLocal&) = delete;
<mask> ThreadLocal& operator=(const ThreadLocal&) = delete;
<mask>
<mask> T* makeTlp() const {
<mask> auto ptr = constructor_();
<mask> tlp_.reset(ptr);
<mask> return ptr;
<mask> }
<mask>
<mask> mutable ThreadLocalPtr<T, Tag, AccessMode> tlp_;
</s> [sdk33] Update iOS with RN 0.59 </s> remove explicit ThreadLocal(std::function<T*()> constructor) :
constructor_(constructor) {
}
T* get() const {
T* ptr = tlp_.get();
if (LIKELY(ptr != nullptr)) {
return ptr;
}
// separated new item creation out to speed up the fast path.
return makeTlp();
</s> add template <
typename F,
_t<std::enable_if<is_invocable_r<T*, F>::value, int>> = 0>
explicit ThreadLocal(F&& constructor)
: constructor_(std::forward<F>(constructor)) {}
FOLLY_ALWAYS_INLINE FOLLY_ATTR_VISIBILITY_HIDDEN T* get() const {
auto const ptr = tlp_.get();
return FOLLY_LIKELY(!!ptr) ? ptr : makeTlp(); </s> remove } // namespace folly
</s> add namespace threadlocal_detail {
template <typename>
struct static_meta_of;
template <typename T, typename Tag, typename AccessMode>
struct static_meta_of<ThreadLocalPtr<T, Tag, AccessMode>> {
using type = StaticMeta<Tag, AccessMode>;
};
template <typename T, typename Tag, typename AccessMode>
struct static_meta_of<ThreadLocal<T, Tag, AccessMode>> {
using type = StaticMeta<Tag, AccessMode>;
};
} // namespace threadlocal_detail
} // namespace folly </s> remove exec_(Op::NUKE, &data_, nullptr);
</s> add exec(Op::NUKE, &data_, nullptr); </s> remove BenchmarkSuspender(const BenchmarkSuspender &) = delete;
BenchmarkSuspender(BenchmarkSuspender && rhs) noexcept {
</s> add BenchmarkSuspender(const BenchmarkSuspender&) = delete;
BenchmarkSuspender(BenchmarkSuspender&& rhs) noexcept { </s> remove Function& operator=(Function&) = delete;
</s> add </s> remove : ptr_(other.ptr_), data_(std::move(other.data_)) {
other.ptr_ = nullptr;
}
</s> add : ptr_(exchange(other.ptr_, nullptr)), data_(std::move(other.data_)) {}
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/ThreadLocal.h
|
keep keep keep keep replace replace replace keep keep keep keep keep
|
<mask>
<mask> public:
<mask> constexpr ThreadLocalPtr() : id_() {}
<mask>
<mask> ThreadLocalPtr(ThreadLocalPtr&& other) noexcept :
<mask> id_(std::move(other.id_)) {
<mask> }
<mask>
<mask> ThreadLocalPtr& operator=(ThreadLocalPtr&& other) {
<mask> assert(this != &other);
<mask> destroy();
<mask> id_ = std::move(other.id_);
</s> [sdk33] Update iOS with RN 0.59 </s> remove : ti_(other.ti_), tag_ti_(other.tag_ti_) {
}
</s> add : ti_(other.ti_), tag_ti_(other.tag_ti_) {} </s> remove : ptr_(other.ptr_), data_(std::move(other.data_)) {
other.ptr_ = nullptr;
}
</s> add : ptr_(exchange(other.ptr_, nullptr)), data_(std::move(other.data_)) {} </s> remove TypeDescriptor(const std::type_info& ti,
const std::type_info& tag_ti)
: ti_(ti), tag_ti_(tag_ti) {
}
</s> add TypeDescriptor(const std::type_info& ti, const std::type_info& tag_ti)
: ti_(ti), tag_ti_(tag_ti) {} </s> remove ParameterizedDynamicTokenBucket(
const ParameterizedDynamicTokenBucket& other) noexcept
</s> add BasicDynamicTokenBucket(const BasicDynamicTokenBucket& other) noexcept </s> remove constexpr ThreadLocal() : constructor_([]() {
return new T();
}) {}
</s> add constexpr ThreadLocal() : constructor_([]() { return new T(); }) {} </s> remove ParameterizedDynamicTokenBucket& operator=(
const ParameterizedDynamicTokenBucket& other) noexcept {
</s> add BasicDynamicTokenBucket& operator=(
const BasicDynamicTokenBucket& other) noexcept {
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/ThreadLocal.h
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> destroy();
<mask> }
<mask>
<mask> T* get() const {
<mask> threadlocal_detail::ElementWrapper& w = StaticMeta::instance().get(&id_);
<mask> return static_cast<T*>(w.ptr);
<mask> }
<mask>
<mask> T* operator->() const {
<mask> return get();
</s> [sdk33] Update iOS with RN 0.59 </s> remove return &impl_.item;
</s> add return &inner_; </s> remove threadlocal_detail::ElementWrapper& w = StaticMeta::instance().get(&id_);
</s> add threadlocal_detail::ElementWrapper& w = StaticMeta::get(&id_); </s> remove explicit ThreadLocal(std::function<T*()> constructor) :
constructor_(constructor) {
}
T* get() const {
T* ptr = tlp_.get();
if (LIKELY(ptr != nullptr)) {
return ptr;
}
// separated new item creation out to speed up the fast path.
return makeTlp();
</s> add template <
typename F,
_t<std::enable_if<is_invocable_r<T*, F>::value, int>> = 0>
explicit ThreadLocal(F&& constructor)
: constructor_(std::forward<F>(constructor)) {}
FOLLY_ALWAYS_INLINE FOLLY_ATTR_VISIBILITY_HIDDEN T* get() const {
auto const ptr = tlp_.get();
return FOLLY_LIKELY(!!ptr) ? ptr : makeTlp(); </s> remove w.set(newPtr);
</s> add w->set(newPtr); </s> remove return &impl_.item;
</s> add return &inner_; </s> remove threadlocal_detail::ElementWrapper& w = StaticMeta::instance().get(&id_);
</s> add threadlocal_detail::ElementWrapper* w = &StaticMeta::get(&id_);
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/ThreadLocal.h
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> return *get();
<mask> }
<mask>
<mask> T* release() {
<mask> threadlocal_detail::ElementWrapper& w = StaticMeta::instance().get(&id_);
<mask>
<mask> return static_cast<T*>(w.release());
<mask> }
<mask>
<mask> void reset(T* newPtr = nullptr) {
</s> [sdk33] Update iOS with RN 0.59 </s> remove threadlocal_detail::ElementWrapper& w = StaticMeta::instance().get(&id_);
</s> add threadlocal_detail::ElementWrapper* w = &StaticMeta::get(&id_); </s> remove w.dispose(TLPDestructionMode::THIS_THREAD);
</s> add w->dispose(TLPDestructionMode::THIS_THREAD);
// need to get a new ptr since the
// ThreadEntry::elements array can be reallocated
w = &StaticMeta::get(&id_);
w->cleanup(); </s> remove threadlocal_detail::ElementWrapper& w = StaticMeta::instance().get(&id_);
</s> add threadlocal_detail::ElementWrapper& w = StaticMeta::get(&id_); </s> remove w.set(newPtr);
</s> add w->set(newPtr); </s> remove threadlocal_detail::ElementWrapper& w = StaticMeta::instance().get(&id_);
w.dispose(TLPDestructionMode::THIS_THREAD);
</s> add threadlocal_detail::ElementWrapper* w = &StaticMeta::get(&id_);
w->dispose(TLPDestructionMode::THIS_THREAD);
// need to get a new ptr since the
// ThreadEntry::elements array can be reallocated
w = &StaticMeta::get(&id_);
w->cleanup(); </s> remove w.set(newPtr, deleter);
</s> add w->set(newPtr, deleter);
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/ThreadLocal.h
|
keep keep keep keep replace keep replace keep keep
|
<mask> }
<mask>
<mask> void reset(T* newPtr = nullptr) {
<mask> auto guard = makeGuard([&] { delete newPtr; });
<mask> threadlocal_detail::ElementWrapper& w = StaticMeta::instance().get(&id_);
<mask>
<mask> w.dispose(TLPDestructionMode::THIS_THREAD);
<mask> guard.dismiss();
<mask> w.set(newPtr);
</s> [sdk33] Update iOS with RN 0.59 </s> remove threadlocal_detail::ElementWrapper& w = StaticMeta::instance().get(&id_);
</s> add threadlocal_detail::ElementWrapper& w = StaticMeta::get(&id_); </s> remove w.set(newPtr);
</s> add w->set(newPtr); </s> remove threadlocal_detail::ElementWrapper& w = StaticMeta::instance().get(&id_);
w.dispose(TLPDestructionMode::THIS_THREAD);
</s> add threadlocal_detail::ElementWrapper* w = &StaticMeta::get(&id_);
w->dispose(TLPDestructionMode::THIS_THREAD);
// need to get a new ptr since the
// ThreadEntry::elements array can be reallocated
w = &StaticMeta::get(&id_);
w->cleanup(); </s> remove w.set(newPtr, deleter);
</s> add w->set(newPtr, deleter); </s> remove threadlocal_detail::ElementWrapper& w = StaticMeta::instance().get(&id_);
</s> add threadlocal_detail::ElementWrapper& w = StaticMeta::get(&id_);
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/ThreadLocal.h
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> threadlocal_detail::ElementWrapper& w = StaticMeta::instance().get(&id_);
<mask>
<mask> w.dispose(TLPDestructionMode::THIS_THREAD);
<mask> guard.dismiss();
<mask> w.set(newPtr);
<mask> }
<mask>
<mask> explicit operator bool() const {
<mask> return get() != nullptr;
<mask> }
</s> [sdk33] Update iOS with RN 0.59 </s> remove w.dispose(TLPDestructionMode::THIS_THREAD);
</s> add w->dispose(TLPDestructionMode::THIS_THREAD);
// need to get a new ptr since the
// ThreadEntry::elements array can be reallocated
w = &StaticMeta::get(&id_);
w->cleanup(); </s> remove threadlocal_detail::ElementWrapper& w = StaticMeta::instance().get(&id_);
</s> add threadlocal_detail::ElementWrapper* w = &StaticMeta::get(&id_); </s> remove threadlocal_detail::ElementWrapper& w = StaticMeta::instance().get(&id_);
</s> add threadlocal_detail::ElementWrapper& w = StaticMeta::get(&id_); </s> remove threadlocal_detail::ElementWrapper& w = StaticMeta::instance().get(&id_);
w.dispose(TLPDestructionMode::THIS_THREAD);
</s> add threadlocal_detail::ElementWrapper* w = &StaticMeta::get(&id_);
w->dispose(TLPDestructionMode::THIS_THREAD);
// need to get a new ptr since the
// ThreadEntry::elements array can be reallocated
w = &StaticMeta::get(&id_);
w->cleanup(); </s> remove threadlocal_detail::ElementWrapper& w = StaticMeta::instance().get(&id_);
</s> add threadlocal_detail::ElementWrapper& w = StaticMeta::get(&id_); </s> remove w.set(newPtr, deleter);
</s> add w->set(newPtr, deleter);
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/ThreadLocal.h
|
keep keep keep keep replace replace replace keep keep keep keep keep
|
<mask> typename = typename std::enable_if<
<mask> std::is_convertible<SourceT*, T*>::value>::type>
<mask> void reset(std::unique_ptr<SourceT, Deleter> source) {
<mask> auto deleter = [delegate = source.get_deleter()](
<mask> T * ptr, TLPDestructionMode) {
<mask> delegate(ptr);
<mask> };
<mask> reset(source.release(), deleter);
<mask> }
<mask>
<mask> /**
<mask> * reset() that transfers ownership from a smart pointer with the default
</s> [sdk33] Update iOS with RN 0.59 </s> add /**
* Implementation for the assignment operator
*/
template <typename LockPolicyLhs, typename LockPolicyRhs>
void assignImpl(
LockedPtrBase<SynchronizedType, Mutex, LockPolicyLhs>& lhs,
LockedPtrBase<SynchronizedType, Mutex, LockPolicyRhs>& rhs) noexcept {
if (lhs.parent_) {
LockPolicy::unlock(lhs.parent_->mutex_);
}
lhs.parent_ = exchange(rhs.parent_, nullptr);
}
</s> remove static void make_mock(CreateFunc c,
typename Singleton<T>::TeardownFunc t = nullptr) {
</s> add static void make_mock(
CreateFunc c,
typename Singleton<T>::TeardownFunc t = nullptr) { </s> remove template <class SynchronizedType, class LockPolicy>
class LockedGuardPtr {
private:
// CDataType is the DataType with the appropriate const-qualification
using CDataType = detail::SynchronizedDataType<SynchronizedType>;
public:
using DataType = typename SynchronizedType::DataType;
using MutexType = typename SynchronizedType::MutexType;
using Synchronized = typename std::remove_const<SynchronizedType>::type;
LockedGuardPtr() = delete;
/**
* Takes a Synchronized<T> and locks it.
*/
explicit LockedGuardPtr(SynchronizedType* parent) : parent_(parent) {
LockPolicy::lock(parent_->mutex_);
}
/**
* Destructor releases.
*/
~LockedGuardPtr() {
LockPolicy::unlock(parent_->mutex_);
}
/**
* Access the locked data.
*/
CDataType* operator->() const {
return &parent_->datum_;
}
</s> add template <typename D, typename M, typename... Args>
auto wlock(Synchronized<D, M>& synchronized, Args&&... args) {
return detail::wlock(synchronized, std::forward<Args>(args)...);
}
template <typename Data, typename Mutex, typename... Args>
auto rlock(const Synchronized<Data, Mutex>& synchronized, Args&&... args) {
return detail::rlock(synchronized, std::forward<Args>(args)...);
}
template <typename D, typename M, typename... Args>
auto ulock(Synchronized<D, M>& synchronized, Args&&... args) {
return detail::ulock(synchronized, std::forward<Args>(args)...);
}
template <typename D, typename M, typename... Args>
auto lock(Synchronized<D, M>& synchronized, Args&&... args) {
return detail::lock(synchronized, std::forward<Args>(args)...);
}
template <typename D, typename M, typename... Args>
auto lock(const Synchronized<D, M>& synchronized, Args&&... args) {
return detail::lock(synchronized, std::forward<Args>(args)...);
} </s> remove struct DynamicConverter<T,
typename std::enable_if<std::is_integral<T>::value &&
!std::is_same<T, bool>::value>::type> {
</s> add struct DynamicConverter<
T,
typename std::enable_if<
std::is_integral<T>::value && !std::is_same<T, bool>::value>::type> { </s> add /**
* For assigning from a `Function<X(Ys..) [const?]>`.
*/
template <
typename Signature,
typename = typename Traits::template ResultOf<Function<Signature>>>
Function& operator=(Function<Signature>&& that) noexcept(
noexcept(Function(std::move(that)))) {
return (*this = Function(std::move(that)));
}
</s> add // This version of doNotOptimizeAway tells the compiler that the asm
// block will read datum from memory, and that in addition it might read
// or write from any memory location. If the memory clobber could be
// separated into input and output that would be preferrable.
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/ThreadLocal.h
|
keep keep keep replace replace keep replace keep keep
|
<mask> deleter(newPtr, TLPDestructionMode::THIS_THREAD);
<mask> }
<mask> });
<mask> threadlocal_detail::ElementWrapper& w = StaticMeta::instance().get(&id_);
<mask> w.dispose(TLPDestructionMode::THIS_THREAD);
<mask> guard.dismiss();
<mask> w.set(newPtr, deleter);
<mask> }
<mask>
</s> [sdk33] Update iOS with RN 0.59 </s> remove threadlocal_detail::ElementWrapper& w = StaticMeta::instance().get(&id_);
</s> add threadlocal_detail::ElementWrapper* w = &StaticMeta::get(&id_); </s> remove w.set(newPtr);
</s> add w->set(newPtr); </s> remove w.dispose(TLPDestructionMode::THIS_THREAD);
</s> add w->dispose(TLPDestructionMode::THIS_THREAD);
// need to get a new ptr since the
// ThreadEntry::elements array can be reallocated
w = &StaticMeta::get(&id_);
w->cleanup(); </s> remove threadlocal_detail::ElementWrapper& w = StaticMeta::instance().get(&id_);
</s> add threadlocal_detail::ElementWrapper& w = StaticMeta::get(&id_); </s> remove threadlocal_detail::ElementWrapper& w = StaticMeta::instance().get(&id_);
</s> add threadlocal_detail::ElementWrapper& w = StaticMeta::get(&id_);
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/ThreadLocal.h
|
keep keep keep replace replace replace replace keep replace keep keep keep keep
|
<mask> friend class Iterator;
<mask>
<mask> // The iterators obtained from Accessor are bidirectional iterators.
<mask> class Iterator : public boost::iterator_facade<
<mask> Iterator, // Derived
<mask> T, // value_type
<mask> boost::bidirectional_traversal_tag> { // traversal
<mask> friend class Accessor;
<mask> friend class boost::iterator_core_access;
<mask> const Accessor* accessor_;
<mask> threadlocal_detail::ThreadEntry* e_;
<mask>
<mask> void increment() {
</s> [sdk33] Update iOS with RN 0.59 </s> remove threadlocal_detail::ThreadEntry* e_;
</s> add threadlocal_detail::ThreadEntryNode* e_; </s> remove template<class,class> friend class csl_iterator;
</s> add template <class, class>
friend class csl_iterator; </s> remove void increment() { node_ = node_->next(); };
bool equal(const csl_iterator& other) const { return node_ == other.node_; }
value_type& dereference() const { return node_->data(); }
</s> add void increment() {
node_ = node_->next();
}
bool equal(const csl_iterator& other) const {
return node_ == other.node_;
}
value_type& dereference() const {
return node_->data();
} </s> remove class Transformer : public boost::iterator_adaptor<
Transformer<T, It>,
It,
typename T::value_type
> {
</s> add class Transformer
: public boost::
iterator_adaptor<Transformer<T, It>, It, typename T::value_type> { </s> remove e_ = e_->next;
</s> add e_ = e_->getNext();
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/ThreadLocal.h
|
keep keep keep keep replace keep keep replace keep keep keep
|
<mask> boost::bidirectional_traversal_tag> { // traversal
<mask> friend class Accessor;
<mask> friend class boost::iterator_core_access;
<mask> const Accessor* accessor_;
<mask> threadlocal_detail::ThreadEntry* e_;
<mask>
<mask> void increment() {
<mask> e_ = e_->next;
<mask> incrementToValid();
<mask> }
<mask>
</s> [sdk33] Update iOS with RN 0.59 </s> remove friend class boost::iterator_core_access;
</s> add </s> remove class Iterator : public boost::iterator_facade<
Iterator, // Derived
T, // value_type
boost::bidirectional_traversal_tag> { // traversal
</s> add class Iterator { </s> remove template<class,class> friend class csl_iterator;
</s> add template <class, class>
friend class csl_iterator; </s> remove void increment() { node_ = node_->next(); };
bool equal(const csl_iterator& other) const { return node_ == other.node_; }
value_type& dereference() const { return node_->data(); }
</s> add void increment() {
node_ = node_->next();
}
bool equal(const csl_iterator& other) const {
return node_ == other.node_;
}
value_type& dereference() const {
return node_->data();
} </s> remove mutable ttype cache_;
mutable bool valid_;
</s> add mutable Optional<ttype> cache_;
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/ThreadLocal.h
|
keep keep replace keep keep keep replace replace keep keep
|
<mask>
<mask> void decrement() {
<mask> e_ = e_->prev;
<mask> decrementToValid();
<mask> }
<mask>
<mask> T& dereference() const {
<mask> return *static_cast<T*>(e_->elements[accessor_->id_].ptr);
<mask> }
<mask>
</s> [sdk33] Update iOS with RN 0.59 </s> remove e_ = e_->next;
</s> add e_ = e_->getNext(); </s> remove return (accessor_->id_ == other.accessor_->id_ &&
e_ == other.e_);
</s> add return (accessor_->id_ == other.accessor_->id_ && e_ == other.e_); </s> remove for (; e_ != &accessor_->meta_.head_ && !valid(); e_ = e_->prev) { }
</s> add for (; e_ != &accessor_->meta_.head_.elements[accessor_->id_].node &&
!valid();
e_ = e_->getPrev()) {
}
}
public:
using difference_type = ssize_t;
using value_type = T;
using reference = T const&;
using pointer = T const*;
using iterator_category = std::bidirectional_iterator_tag;
Iterator& operator++() {
increment();
return *this;
}
Iterator& operator++(int) {
Iterator copy(*this);
increment();
return copy;
}
Iterator& operator--() {
decrement();
return *this;
}
Iterator& operator--(int) {
Iterator copy(*this);
decrement();
return copy;
}
T& operator*() {
return dereference();
}
T const& operator*() const {
return dereference();
}
T* operator->() {
return &dereference();
}
T const* operator->() const {
return &dereference();
}
bool operator==(Iterator const& rhs) const {
return equal(rhs);
}
bool operator!=(Iterator const& rhs) const {
return !equal(rhs); </s> remove for (; e_ != &accessor_->meta_.head_ && !valid(); e_ = e_->next) { }
</s> add for (; e_ != &accessor_->meta_.head_.elements[accessor_->id_].node &&
!valid();
e_ = e_->getNext()) {
} </s> remove return (e_->elements &&
accessor_->id_ < e_->elementsCapacity &&
e_->elements[accessor_->id_].ptr);
</s> add return (e_->getThreadEntry()->elements[accessor_->id_].ptr);
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/ThreadLocal.h
|
keep keep keep keep replace replace keep keep keep replace replace replace keep keep keep keep
|
<mask> return *static_cast<T*>(e_->elements[accessor_->id_].ptr);
<mask> }
<mask>
<mask> bool equal(const Iterator& other) const {
<mask> return (accessor_->id_ == other.accessor_->id_ &&
<mask> e_ == other.e_);
<mask> }
<mask>
<mask> explicit Iterator(const Accessor* accessor)
<mask> : accessor_(accessor),
<mask> e_(&accessor_->meta_.head_) {
<mask> }
<mask>
<mask> bool valid() const {
<mask> return (e_->elements &&
<mask> accessor_->id_ < e_->elementsCapacity &&
</s> [sdk33] Update iOS with RN 0.59 </s> remove T& dereference() const {
return *static_cast<T*>(e_->elements[accessor_->id_].ptr);
</s> add const T& dereference() const {
return *static_cast<T*>(
e_->getThreadEntry()->elements[accessor_->id_].ptr);
}
T& dereference() {
return *static_cast<T*>(
e_->getThreadEntry()->elements[accessor_->id_].ptr); </s> remove return (e_->elements &&
accessor_->id_ < e_->elementsCapacity &&
e_->elements[accessor_->id_].ptr);
</s> add return (e_->getThreadEntry()->elements[accessor_->id_].ptr); </s> add // we just need to check the ptr since it can be set to nullptr
// even if the entry is part of the list </s> remove for (; e_ != &accessor_->meta_.head_ && !valid(); e_ = e_->prev) { }
</s> add for (; e_ != &accessor_->meta_.head_.elements[accessor_->id_].node &&
!valid();
e_ = e_->getPrev()) {
}
}
public:
using difference_type = ssize_t;
using value_type = T;
using reference = T const&;
using pointer = T const*;
using iterator_category = std::bidirectional_iterator_tag;
Iterator& operator++() {
increment();
return *this;
}
Iterator& operator++(int) {
Iterator copy(*this);
increment();
return copy;
}
Iterator& operator--() {
decrement();
return *this;
}
Iterator& operator--(int) {
Iterator copy(*this);
decrement();
return copy;
}
T& operator*() {
return dereference();
}
T const& operator*() const {
return dereference();
}
T* operator->() {
return &dereference();
}
T const* operator->() const {
return &dereference();
}
bool operator==(Iterator const& rhs) const {
return equal(rhs);
}
bool operator!=(Iterator const& rhs) const {
return !equal(rhs); </s> remove void increment() { node_ = node_->next(); };
bool equal(const csl_iterator& other) const { return node_ == other.node_; }
value_type& dereference() const { return node_->data(); }
</s> add void increment() {
node_ = node_->next();
}
bool equal(const csl_iterator& other) const {
return node_ == other.node_;
}
value_type& dereference() const {
return node_->data();
}
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/ThreadLocal.h
|
keep keep keep add keep keep keep keep keep keep
|
<mask> explicit Iterator(const Accessor* accessor)
<mask> : accessor_(accessor),
<mask> e_(&accessor_->meta_.head_.elements[accessor_->id_].node) {}
<mask>
<mask> bool valid() const {
<mask> return (e_->getThreadEntry()->elements[accessor_->id_].ptr);
<mask> }
<mask>
<mask> void incrementToValid() {
<mask> for (; e_ != &accessor_->meta_.head_.elements[accessor_->id_].node &&
</s> [sdk33] Update iOS with RN 0.59 </s> remove : accessor_(accessor),
e_(&accessor_->meta_.head_) {
}
</s> add : accessor_(accessor),
e_(&accessor_->meta_.head_.elements[accessor_->id_].node) {} </s> remove return (e_->elements &&
accessor_->id_ < e_->elementsCapacity &&
e_->elements[accessor_->id_].ptr);
</s> add return (e_->getThreadEntry()->elements[accessor_->id_].ptr); </s> remove return (accessor_->id_ == other.accessor_->id_ &&
e_ == other.e_);
</s> add return (accessor_->id_ == other.accessor_->id_ && e_ == other.e_); </s> remove for (; e_ != &accessor_->meta_.head_ && !valid(); e_ = e_->next) { }
</s> add for (; e_ != &accessor_->meta_.head_.elements[accessor_->id_].node &&
!valid();
e_ = e_->getNext()) {
} </s> remove for (; e_ != &accessor_->meta_.head_ && !valid(); e_ = e_->prev) { }
</s> add for (; e_ != &accessor_->meta_.head_.elements[accessor_->id_].node &&
!valid();
e_ = e_->getPrev()) {
}
}
public:
using difference_type = ssize_t;
using value_type = T;
using reference = T const&;
using pointer = T const*;
using iterator_category = std::bidirectional_iterator_tag;
Iterator& operator++() {
increment();
return *this;
}
Iterator& operator++(int) {
Iterator copy(*this);
increment();
return copy;
}
Iterator& operator--() {
decrement();
return *this;
}
Iterator& operator--(int) {
Iterator copy(*this);
decrement();
return copy;
}
T& operator*() {
return dereference();
}
T const& operator*() const {
return dereference();
}
T* operator->() {
return &dereference();
}
T const* operator->() const {
return &dereference();
}
bool operator==(Iterator const& rhs) const {
return equal(rhs);
}
bool operator!=(Iterator const& rhs) const {
return !equal(rhs); </s> remove e_ = e_->next;
</s> add e_ = e_->getNext();
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/ThreadLocal.h
|
keep keep keep keep replace replace replace keep keep keep replace keep keep keep
|
<mask> e_(&accessor_->meta_.head_) {
<mask> }
<mask>
<mask> bool valid() const {
<mask> return (e_->elements &&
<mask> accessor_->id_ < e_->elementsCapacity &&
<mask> e_->elements[accessor_->id_].ptr);
<mask> }
<mask>
<mask> void incrementToValid() {
<mask> for (; e_ != &accessor_->meta_.head_ && !valid(); e_ = e_->next) { }
<mask> }
<mask>
<mask> void decrementToValid() {
</s> [sdk33] Update iOS with RN 0.59 </s> remove : accessor_(accessor),
e_(&accessor_->meta_.head_) {
}
</s> add : accessor_(accessor),
e_(&accessor_->meta_.head_.elements[accessor_->id_].node) {} </s> remove for (; e_ != &accessor_->meta_.head_ && !valid(); e_ = e_->prev) { }
</s> add for (; e_ != &accessor_->meta_.head_.elements[accessor_->id_].node &&
!valid();
e_ = e_->getPrev()) {
}
}
public:
using difference_type = ssize_t;
using value_type = T;
using reference = T const&;
using pointer = T const*;
using iterator_category = std::bidirectional_iterator_tag;
Iterator& operator++() {
increment();
return *this;
}
Iterator& operator++(int) {
Iterator copy(*this);
increment();
return copy;
}
Iterator& operator--() {
decrement();
return *this;
}
Iterator& operator--(int) {
Iterator copy(*this);
decrement();
return copy;
}
T& operator*() {
return dereference();
}
T const& operator*() const {
return dereference();
}
T* operator->() {
return &dereference();
}
T const* operator->() const {
return &dereference();
}
bool operator==(Iterator const& rhs) const {
return equal(rhs);
}
bool operator!=(Iterator const& rhs) const {
return !equal(rhs); </s> add // we just need to check the ptr since it can be set to nullptr
// even if the entry is part of the list </s> remove return (accessor_->id_ == other.accessor_->id_ &&
e_ == other.e_);
</s> add return (accessor_->id_ == other.accessor_->id_ && e_ == other.e_); </s> remove T& dereference() const {
return *static_cast<T*>(e_->elements[accessor_->id_].ptr);
</s> add const T& dereference() const {
return *static_cast<T*>(
e_->getThreadEntry()->elements[accessor_->id_].ptr);
}
T& dereference() {
return *static_cast<T*>(
e_->getThreadEntry()->elements[accessor_->id_].ptr);
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/ThreadLocal.h
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> for (; e_ != &accessor_->meta_.head_ && !valid(); e_ = e_->next) { }
<mask> }
<mask>
<mask> void decrementToValid() {
<mask> for (; e_ != &accessor_->meta_.head_ && !valid(); e_ = e_->prev) { }
<mask> }
<mask> };
<mask>
<mask> ~Accessor() {
<mask> release();
</s> [sdk33] Update iOS with RN 0.59 </s> remove for (; e_ != &accessor_->meta_.head_ && !valid(); e_ = e_->next) { }
</s> add for (; e_ != &accessor_->meta_.head_.elements[accessor_->id_].node &&
!valid();
e_ = e_->getNext()) {
} </s> remove return (e_->elements &&
accessor_->id_ < e_->elementsCapacity &&
e_->elements[accessor_->id_].ptr);
</s> add return (e_->getThreadEntry()->elements[accessor_->id_].ptr); </s> remove e_ = e_->next;
</s> add e_ = e_->getNext(); </s> add // we just need to check the ptr since it can be set to nullptr
// even if the entry is part of the list </s> remove e_ = e_->prev;
</s> add e_ = e_->getPrev(); </s> remove return (accessor_->id_ == other.accessor_->id_ &&
e_ == other.e_);
</s> add return (accessor_->id_ == other.accessor_->id_ && e_ == other.e_);
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/ThreadLocal.h
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask>
<mask> // accessor allows a client to iterate through all thread local child
<mask> // elements of this ThreadLocal instance. Holds a global lock for each <Tag>
<mask> Accessor accessAllThreads() const {
<mask> static_assert(!std::is_same<Tag, void>::value,
<mask> "Must use a unique Tag to use the accessAllThreads feature");
<mask> return Accessor(id_.getOrAllocate(StaticMeta::instance()));
<mask> }
<mask>
<mask> private:
<mask> void destroy() {
</s> [sdk33] Update iOS with RN 0.59 </s> remove w.set(newPtr, deleter);
</s> add w->set(newPtr, deleter); </s> remove threadlocal_detail::ElementWrapper& w = StaticMeta::instance().get(&id_);
w.dispose(TLPDestructionMode::THIS_THREAD);
</s> add threadlocal_detail::ElementWrapper* w = &StaticMeta::get(&id_);
w->dispose(TLPDestructionMode::THIS_THREAD);
// need to get a new ptr since the
// ThreadEntry::elements array can be reallocated
w = &StaticMeta::get(&id_);
w->cleanup(); </s> remove template <class IntT, class Tag=IntT>
</s> add template <class IntT, class Tag = IntT> </s> remove // each must be given a unique tag. If no tag is specified - default tag is used
</s> add // each must be given a unique tag. If no tag is specified a default tag is
// used. We recommend that you use a tag from an anonymous namespace private to
// your implementation file, as this ensures that the singleton is only
// available via your interface and not also through Singleton<T>::try_get() </s> remove auto accessor = cache_.accessAllThreads();
</s> add const auto accessor = cache_.accessAllThreads(); </s> remove template <typename T,
typename Tag = detail::DefaultTag,
typename VaultTag = detail::DefaultTag /* for testing */>
</s> add template <
typename T,
typename Tag = detail::DefaultTag,
typename VaultTag = detail::DefaultTag /* for testing */>
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/ThreadLocal.h
|
keep keep keep keep replace
|
<mask>
<mask> mutable typename StaticMeta::EntryID id_;
<mask> };
<mask>
<mask> } // namespace folly
</s> [sdk33] Update iOS with RN 0.59 </s> remove
}
</s> add } // namespace folly </s> remove } // namespace folly
</s> add } // namespace folly </s> remove }
</s> add } // namespace folly </s> remove } // namespace folly
</s> add FOLLY_POP_WARNING </s> remove }} // namespaces
</s> add } // namespace detail
} // namespace folly </s> remove } // namespace detail
</s> add } // namespace folly
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/ThreadLocal.h
|
keep replace keep keep keep keep keep
|
<mask> /*
<mask> * Copyright 2016 Facebook, Inc.
<mask> *
<mask> * Licensed under the Apache License, Version 2.0 (the "License");
<mask> * you may not use this file except in compliance with the License.
<mask> * You may obtain a copy of the License at
<mask> *
</s> [sdk33] Update iOS with RN 0.59
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/TimeoutQueue.h
|
keep keep replace keep replace keep keep
|
<mask> #pragma once
<mask>
<mask> #include <stdint.h>
<mask> #include <functional>
<mask> #include <boost/multi_index_container.hpp>
<mask> #include <boost/multi_index/indexed_by.hpp>
<mask> #include <boost/multi_index/ordered_index.hpp>
</s> [sdk33] Update iOS with RN 0.59 </s> remove #include <boost/multi_index/ordered_index.hpp>
</s> add </s> add #include <boost/multi_index/ordered_index.hpp>
#include <boost/multi_index_container.hpp> </s> remove #include <memory>
</s> add #include <functional> </s> add #include <cassert> </s> add #include <cstdint>
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/TimeoutQueue.h
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> #include <stdint.h>
<mask> #include <functional>
<mask> #include <boost/multi_index_container.hpp>
<mask> #include <boost/multi_index/indexed_by.hpp>
<mask> #include <boost/multi_index/ordered_index.hpp>
<mask> #include <boost/multi_index/member.hpp>
<mask>
<mask> namespace folly {
<mask>
<mask> class TimeoutQueue {
</s> [sdk33] Update iOS with RN 0.59 </s> remove #include <boost/multi_index_container.hpp>
</s> add </s> add #include <boost/multi_index/ordered_index.hpp>
#include <boost/multi_index_container.hpp> </s> remove #include <stdint.h>
</s> add #include <cstdint> </s> add #include <boost/function_types/function_arity.hpp>
#include <glog/logging.h>
</s> remove #include <type_traits>
#include <utility>
namespace folly {
enum class TLPDestructionMode {
THIS_THREAD,
ALL_THREADS
};
struct AccessModeStrict {};
} // namespace
</s> add </s> remove #include <folly/MicroSpinLock.h>
</s> add
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/TimeoutQueue.h
|
keep keep add keep keep keep keep keep keep
|
<mask>
<mask> #include <boost/multi_index/indexed_by.hpp>
<mask> #include <boost/multi_index/member.hpp>
<mask>
<mask> namespace folly {
<mask>
<mask> class TimeoutQueue {
<mask> public:
<mask> typedef int64_t Id;
</s> [sdk33] Update iOS with RN 0.59 </s> remove #include <boost/multi_index/ordered_index.hpp>
</s> add </s> remove #include <boost/multi_index_container.hpp>
</s> add </s> remove #include <stdint.h>
</s> add #include <cstdint> </s> remove namespace folly { namespace detail {
</s> add namespace folly {
namespace detail { </s> remove #include <type_traits>
#include <utility>
namespace folly {
enum class TLPDestructionMode {
THIS_THREAD,
ALL_THREADS
};
struct AccessModeStrict {};
} // namespace
</s> add </s> remove #include <folly/MicroSpinLock.h>
</s> add
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/TimeoutQueue.h
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> public:
<mask> typedef int64_t Id;
<mask> typedef std::function<void(Id, int64_t)> Callback;
<mask>
<mask> TimeoutQueue() : nextId_(1) { }
<mask>
<mask> /**
<mask> * Add a one-time timeout event that will fire "delay" time units from "now"
<mask> * (that is, the first time that run*() is called with a time value >= now
<mask> * + delay).
</s> [sdk33] Update iOS with RN 0.59 </s> remove int64_t runOnce(int64_t now) { return runInternal(now, true); }
int64_t runLoop(int64_t now) { return runInternal(now, false); }
</s> add int64_t runOnce(int64_t now) {
return runInternal(now, true);
}
int64_t runLoop(int64_t now) {
return runInternal(now, false);
} </s> add /**
* Returns the current time in seconds since Epoch.
*/
static double defaultClockNow() noexcept {
using dur = std::chrono::duration<double>;
auto const now = Clock::now().time_since_epoch();
return std::chrono::duration_cast<dur>(now).count();
}
</s> remove * Accumulates nanoseconds spent outside benchmark.
</s> add * Accumulates time spent outside benchmark. </s> remove /*
</s> add /** </s> add #include <boost/multi_index/ordered_index.hpp>
#include <boost/multi_index_container.hpp> </s> remove * Constructs a new `Function` from any callable object. This
* handles function pointers, pointers to static member functions,
* `std::reference_wrapper` objects, `std::function` objects, and arbitrary
* objects that implement `operator()` if the parameter signature
* matches (i.e. it returns R when called with Args...).
* For a `Function` with a const function type, the object must be
* callable from a const-reference, i.e. implement `operator() const`.
* For a `Function` with a non-const function type, the object will
* be called from a non-const reference, which means that it will execute
* a non-const `operator()` if it is defined, and falls back to
* `operator() const` otherwise.
</s> add * Constructs a new `Function` from any callable object that is _not_ a
* `folly::Function`. This handles function pointers, pointers to static
* member functions, `std::reference_wrapper` objects, `std::function`
* objects, and arbitrary objects that implement `operator()` if the parameter
* signature matches (i.e. it returns an object convertible to `R` when called
* with `Args...`).
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/TimeoutQueue.h
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask> *
<mask> * Return the time that the next event will be due (same as
<mask> * nextExpiration(), below)
<mask> */
<mask> int64_t runOnce(int64_t now) { return runInternal(now, true); }
<mask> int64_t runLoop(int64_t now) { return runInternal(now, false); }
<mask>
<mask> /**
<mask> * Return the time that the next event will be due.
<mask> */
<mask> int64_t nextExpiration() const;
</s> [sdk33] Update iOS with RN 0.59 </s> remove TimeoutQueue() : nextId_(1) { }
</s> add TimeoutQueue() : nextId_(1) {} </s> remove * void addValue(uint n, int64_t bucketSize, int64_t min, int64_t max) {
</s> add * void addValue(uint32_t n, int64_t bucketSize, int64_t min, int64_t max) { </s> add /**
* Returns the current time in seconds since Epoch.
*/
static double defaultClockNow() noexcept {
using dur = std::chrono::duration<double>;
auto const now = Clock::now().time_since_epoch();
return std::chrono::duration_cast<dur>(now).count();
}
</s> remove /*
* Note: C++ 17 adds guaranteed copy elision. (http://wg21.link/P0135)
* Once compilers support this, it would be nice to add guard() methods that
* return LockedGuardPtr objects.
*/
</s> add </s> add /**
* Attempts to acquire the lock in exclusive mode. If acquisition is
* unsuccessful, the returned LockedPtr will be null.
*
* (Use LockedPtr::operator bool() or LockedPtr::isNull() to check for
* validity.)
*/
TryLockedPtr tryLock() {
return TryLockedPtr{static_cast<Subclass*>(this)};
}
ConstTryLockedPtr tryLock() const {
return ConstTryLockedPtr{static_cast<const Subclass*>(this)};
}
</s> remove /**
* Access the locked data.
*/
CDataType& operator*() const {
return parent_->datum_;
}
</s> add /**
* Acquire locks for multiple Synchronized<> objects, in a deadlock-safe
* manner.
*
* Wrap the synchronized instances with the appropriate locking strategy by
* using one of the four strategies - folly::lock (exclusive acquire for
* exclusive only mutexes), folly::rlock (shared acquire for shareable
* mutexes), folly::wlock (exclusive acquire for shareable mutexes) or
* folly::ulock (upgrade acquire for upgrade mutexes) (see above)
*
* The locks will be acquired and the passed callable will be invoked with the
* LockedPtr instances in the order that they were passed to the function
*/
template <typename Func, typename... SynchronizedLockers>
decltype(auto) synchronized(Func&& func, SynchronizedLockers&&... lockers) {
return apply(
std::forward<Func>(func),
lock(std::forward<SynchronizedLockers>(lockers)...));
}
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/TimeoutQueue.h
|
keep keep keep keep replace replace replace replace replace replace replace replace replace replace keep keep replace replace keep keep keep
|
<mask> Callback callback;
<mask> };
<mask>
<mask> typedef boost::multi_index_container<
<mask> Event,
<mask> boost::multi_index::indexed_by<
<mask> boost::multi_index::ordered_unique<boost::multi_index::member<
<mask> Event, Id, &Event::id
<mask> >>,
<mask> boost::multi_index::ordered_non_unique<boost::multi_index::member<
<mask> Event, int64_t, &Event::expiration
<mask> >>
<mask> >
<mask> > Set;
<mask>
<mask> enum {
<mask> BY_ID=0,
<mask> BY_EXPIRATION=1
<mask> };
<mask>
<mask> Set timeouts_;
</s> [sdk33] Update iOS with RN 0.59 </s> remove } // namespace folly
</s> add } // namespace folly </s> remove // Hook into boost's type traits
namespace boost {
template <class T>
struct has_nothrow_constructor<folly::basic_fbstring<T> > : true_type {
enum { value = true };
};
} // namespace boost
</s> add </s> remove template <class T, class Enable = void>
struct IsSomeVector {
enum { value = false };
};
template <class T>
struct IsSomeVector<std::vector<T>, void> {
enum { value = true };
};
template <class T>
struct IsSomeVector<fbvector<T>, void> {
enum { value = true };
};
template <class T, class Enable = void>
struct IsConvertible {
enum { value = false };
};
template <class T>
struct IsConvertible<
T,
decltype(static_cast<void>(
parseTo(std::declval<folly::StringPiece>(), std::declval<T&>())))> {
enum { value = true };
};
template <class... Types>
struct AllConvertible;
template <class Head, class... Tail>
struct AllConvertible<Head, Tail...> {
enum { value = IsConvertible<Head>::value && AllConvertible<Tail...>::value };
};
</s> add namespace detail {
template <typename Void, typename OutputType>
struct IsConvertible : std::false_type {}; </s> remove class Transformer : public boost::iterator_adaptor<
Transformer<T, It>,
It,
typename T::value_type
> {
</s> add class Transformer
: public boost::
iterator_adaptor<Transformer<T, It>, It, typename T::value_type> { </s> remove enum class Op { MOVE, NUKE, FULL, HEAP };
</s> add enum class Op { MOVE, NUKE, HEAP };
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/TimeoutQueue.h
|
keep keep keep keep replace
|
<mask> Set timeouts_;
<mask> Id nextId_;
<mask> };
<mask>
<mask> } // namespace folly
</s> [sdk33] Update iOS with RN 0.59 </s> remove BY_ID=0,
BY_EXPIRATION=1
</s> add BY_ID = 0,
BY_EXPIRATION = 1, </s> remove }
</s> add } // namespace folly </s> remove } // namespace folly
</s> add FOLLY_POP_WARNING </s> remove }} // namespaces
</s> add } // namespace detail
} // namespace folly </s> remove } // namespace detail
</s> add } // namespace folly </s> remove }
</s> add } // namespace folly
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/TimeoutQueue.h
|
keep replace keep keep keep keep keep
|
<mask> /*
<mask> * Copyright 2016 Facebook, Inc.
<mask> *
<mask> * Licensed under the Apache License, Version 2.0 (the "License");
<mask> * you may not use this file except in compliance with the License.
<mask> * You may obtain a copy of the License at
<mask> *
</s> [sdk33] Update iOS with RN 0.59
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/TokenBucket.h
|
keep replace keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace keep keep
|
<mask> #include <folly/Likely.h>
<mask> #include <folly/detail/CacheLocality.h>
<mask>
<mask> namespace folly {
<mask>
<mask> /**
<mask> * Default clock class used by ParameterizedDynamicTokenBucket and derived
<mask> * classes. User-defined clock classes must be steady (monotonic) and define a
<mask> * static function std::chrono::duration<> timeSinceEpoch().
<mask> */
<mask> struct DefaultTokenBucketClock {
<mask> static auto timeSinceEpoch() noexcept
<mask> -> decltype(std::chrono::steady_clock::now().time_since_epoch()) {
<mask> return std::chrono::steady_clock::now().time_since_epoch();
<mask> }
<mask> };
<mask>
<mask> /**
<mask> * Thread-safe (atomic) token bucket implementation.
</s> [sdk33] Update iOS with RN 0.59 </s> remove * @tparam ClockT Clock type, must be steady i.e. monotonic.
</s> add * @tparam Clock Clock type, must be steady i.e. monotonic. </s> remove template <typename ClockT = DefaultTokenBucketClock>
class ParameterizedDynamicTokenBucket {
</s> add template <typename Clock = std::chrono::steady_clock>
class BasicDynamicTokenBucket {
static_assert(Clock::is_steady, "clock must be steady");
</s> remove template <typename ClockT = DefaultTokenBucketClock>
class ParameterizedTokenBucket {
</s> add template <typename Clock = std::chrono::steady_clock>
class BasicTokenBucket {
static_assert(Clock::is_steady, "clock must be steady");
</s> remove #include <type_traits>
#include <utility>
namespace folly {
enum class TLPDestructionMode {
THIS_THREAD,
ALL_THREADS
};
struct AccessModeStrict {};
} // namespace
</s> add </s> remove * Specialization of ParameterizedDynamicTokenBucket with a fixed token
</s> add * Specialization of BasicDynamicTokenBucket with a fixed token
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/TokenBucket.h
|
keep keep replace keep replace replace keep keep
|
<mask> * burst size to change with every token consumption.
<mask> *
<mask> * @tparam ClockT Clock type, must be steady i.e. monotonic.
<mask> */
<mask> template <typename ClockT = DefaultTokenBucketClock>
<mask> class ParameterizedDynamicTokenBucket {
<mask> public:
<mask> /**
</s> [sdk33] Update iOS with RN 0.59 </s> remove template <typename ClockT = DefaultTokenBucketClock>
class ParameterizedTokenBucket {
</s> add template <typename Clock = std::chrono::steady_clock>
class BasicTokenBucket {
static_assert(Clock::is_steady, "clock must be steady");
</s> remove * Specialization of ParameterizedDynamicTokenBucket with a fixed token
</s> add * Specialization of BasicDynamicTokenBucket with a fixed token </s> remove using Impl = ParameterizedDynamicTokenBucket<ClockT>;
</s> add using Impl = BasicDynamicTokenBucket<Clock>; </s> remove /**
* Default clock class used by ParameterizedDynamicTokenBucket and derived
* classes. User-defined clock classes must be steady (monotonic) and define a
* static function std::chrono::duration<> timeSinceEpoch().
*/
struct DefaultTokenBucketClock {
static auto timeSinceEpoch() noexcept
-> decltype(std::chrono::steady_clock::now().time_since_epoch()) {
return std::chrono::steady_clock::now().time_since_epoch();
}
};
</s> add </s> remove FOLLY_ALIGN_TO_AVOID_FALSE_SHARING std::atomic<double> zeroTime_;
</s> add alignas(hardware_destructive_interference_size) std::atomic<double> zeroTime_;
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/TokenBucket.h
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> * @param zeroTime Initial time at which to consider the token bucket
<mask> * starting to fill. Defaults to 0, so by default token
<mask> * buckets are "full" after construction.
<mask> */
<mask> explicit ParameterizedDynamicTokenBucket(double zeroTime = 0) noexcept
<mask> : zeroTime_(zeroTime) {}
<mask>
<mask> /**
<mask> * Copy constructor.
<mask> *
</s> [sdk33] Update iOS with RN 0.59 </s> remove ParameterizedTokenBucket(
</s> add BasicTokenBucket( </s> remove template <typename ClockT = DefaultTokenBucketClock>
class ParameterizedDynamicTokenBucket {
</s> add template <typename Clock = std::chrono::steady_clock>
class BasicDynamicTokenBucket {
static_assert(Clock::is_steady, "clock must be steady");
</s> remove /**
* Default clock class used by ParameterizedDynamicTokenBucket and derived
* classes. User-defined clock classes must be steady (monotonic) and define a
* static function std::chrono::duration<> timeSinceEpoch().
*/
struct DefaultTokenBucketClock {
static auto timeSinceEpoch() noexcept
-> decltype(std::chrono::steady_clock::now().time_since_epoch()) {
return std::chrono::steady_clock::now().time_since_epoch();
}
};
</s> add </s> add /**
* Returns the current time in seconds since Epoch.
*/
static double defaultClockNow() noexcept {
using dur = std::chrono::duration<double>;
auto const now = Clock::now().time_since_epoch();
return std::chrono::duration_cast<dur>(now).count();
}
</s> remove ParameterizedTokenBucket(const ParameterizedTokenBucket& other) noexcept =
default;
</s> add BasicTokenBucket(const BasicTokenBucket& other) noexcept = default; </s> remove * @tparam ClockT Clock type, must be steady i.e. monotonic.
</s> add * @tparam Clock Clock type, must be steady i.e. monotonic.
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/TokenBucket.h
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask> *
<mask> * Thread-safe. (Copy constructors of derived classes may not be thread-safe
<mask> * however.)
<mask> */
<mask> ParameterizedDynamicTokenBucket(
<mask> const ParameterizedDynamicTokenBucket& other) noexcept
<mask> : zeroTime_(other.zeroTime_.load()) {}
<mask>
<mask> /**
<mask> * Copy-assignment operator.
<mask> *
</s> [sdk33] Update iOS with RN 0.59 </s> remove ParameterizedTokenBucket(const ParameterizedTokenBucket& other) noexcept =
default;
</s> add BasicTokenBucket(const BasicTokenBucket& other) noexcept = default; </s> remove ParameterizedTokenBucket& operator=(
const ParameterizedTokenBucket& other) noexcept = default;
</s> add BasicTokenBucket& operator=(const BasicTokenBucket& other) noexcept = default;
/**
* Returns the current time in seconds since Epoch.
*/
static double defaultClockNow() noexcept(noexcept(Impl::defaultClockNow())) {
return Impl::defaultClockNow();
} </s> remove ParameterizedDynamicTokenBucket& operator=(
const ParameterizedDynamicTokenBucket& other) noexcept {
</s> add BasicDynamicTokenBucket& operator=(
const BasicDynamicTokenBucket& other) noexcept { </s> add template <
typename LockPolicyType,
EnableIfSameUnlockPolicy<LockPolicyType>* = nullptr>
LockedPtr(LockedPtr<SynchronizedType, LockPolicyType>&& other) noexcept
: Base{std::move(other)} {} </s> remove /**
* Default clock class used by ParameterizedDynamicTokenBucket and derived
* classes. User-defined clock classes must be steady (monotonic) and define a
* static function std::chrono::duration<> timeSinceEpoch().
*/
struct DefaultTokenBucketClock {
static auto timeSinceEpoch() noexcept
-> decltype(std::chrono::steady_clock::now().time_since_epoch()) {
return std::chrono::steady_clock::now().time_since_epoch();
}
};
</s> add </s> remove Synchronized(const Synchronized& rhs) /* may throw */
: Synchronized(rhs, rhs.contextualRLock()) {}
</s> add /* implicit */ Synchronized(typename std::conditional<
std::is_copy_constructible<T>::value,
const Synchronized&,
NonImplementedType>::type rhs) /* may throw */
: Synchronized(rhs.copy()) {}
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/TokenBucket.h
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask> *
<mask> * Warning: not thread safe for the object being assigned to (including
<mask> * self-assignment). Thread-safe for the other object.
<mask> */
<mask> ParameterizedDynamicTokenBucket& operator=(
<mask> const ParameterizedDynamicTokenBucket& other) noexcept {
<mask> zeroTime_ = other.zeroTime_.load();
<mask> return *this;
<mask> }
<mask>
<mask> /**
</s> [sdk33] Update iOS with RN 0.59 </s> remove ParameterizedTokenBucket& operator=(
const ParameterizedTokenBucket& other) noexcept = default;
</s> add BasicTokenBucket& operator=(const BasicTokenBucket& other) noexcept = default;
/**
* Returns the current time in seconds since Epoch.
*/
static double defaultClockNow() noexcept(noexcept(Impl::defaultClockNow())) {
return Impl::defaultClockNow();
} </s> remove ParameterizedTokenBucket(const ParameterizedTokenBucket& other) noexcept =
default;
</s> add BasicTokenBucket(const BasicTokenBucket& other) noexcept = default; </s> remove ParameterizedDynamicTokenBucket(
const ParameterizedDynamicTokenBucket& other) noexcept
</s> add BasicDynamicTokenBucket(const BasicDynamicTokenBucket& other) noexcept </s> remove if (&that != this) {
// Q: Why is is safe to destroy and reconstruct this object in place?
// A: Two reasons: First, `Function` is a final class, so in doing this
// we aren't slicing off any derived parts. And second, the move
// operation is guaranteed not to throw so we always leave the object
// in a valid state.
this->~Function();
::new (this) Function(std::move(that));
}
</s> add // Q: Why is it safe to destroy and reconstruct this object in place?
// A: Two reasons: First, `Function` is a final class, so in doing this
// we aren't slicing off any derived parts. And second, the move
// operation is guaranteed not to throw so we always leave the object
// in a valid state.
// In the case of self-move (this == &that), this leaves the object in
// a default-constructed state. First the object is destroyed, then we
// pass the destroyed object to the move constructor. The first thing the
// move constructor does is default-construct the object. That object is
// "moved" into itself, which is a no-op for a default-constructed Function.
this->~Function();
::new (this) Function(std::move(that)); </s> add template <
typename LockPolicyType,
EnableIfSameUnlockPolicy<LockPolicyType>* = nullptr>
LockedPtr& operator=(
LockedPtr<SynchronizedType, LockPolicyType>&& other) noexcept {
Base::operator=(std::move(other));
return *this;
} </s> add /**
* Implementation for the assignment operator
*/
template <typename LockPolicyLhs, typename LockPolicyRhs>
void assignImpl(
LockedPtrBase<SynchronizedType, Mutex, LockPolicyLhs>& lhs,
LockedPtrBase<SynchronizedType, Mutex, LockPolicyRhs>& rhs) noexcept {
if (lhs.parent_) {
LockPolicy::unlock(lhs.parent_->mutex_);
}
lhs.parent_ = exchange(rhs.parent_, nullptr);
}
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/TokenBucket.h
|
keep add keep keep keep keep keep
|
<mask> }
<mask>
<mask> /**
<mask> * Attempts to consume some number of tokens. Tokens are first added to the
<mask> * bucket based on the time elapsed since the last attempt to consume tokens.
<mask> * Note: Attempts to consume more tokens than the burst size will always
<mask> * fail.
</s> [sdk33] Update iOS with RN 0.59 </s> add /**
* Attempts to acquire the lock in exclusive mode. If acquisition is
* unsuccessful, the returned LockedPtr will be null.
*
* (Use LockedPtr::operator bool() or LockedPtr::isNull() to check for
* validity.)
*/
TryLockedPtr tryLock() {
return TryLockedPtr{static_cast<Subclass*>(this)};
}
ConstTryLockedPtr tryLock() const {
return ConstTryLockedPtr{static_cast<const Subclass*>(this)};
}
</s> remove * acquisition is unsuccessful, the returned LockedPtr is NULL.
</s> add * acquisition is unsuccessful, the returned LockedPtr is nullptr. </s> remove * acquisition is unsuccessful, the returned ConstLockedPtr is NULL.
</s> add * acquisition is unsuccessful, the returned ConstLockedPtr is nullptr. </s> remove template <typename ClockT = DefaultTokenBucketClock>
class ParameterizedDynamicTokenBucket {
</s> add template <typename Clock = std::chrono::steady_clock>
class BasicDynamicTokenBucket {
static_assert(Clock::is_steady, "clock must be steady");
</s> remove * Holds a type T, in addition to enough padding to round the size up to the
* next multiple of the false sharing range used by folly.
*
* If T is standard-layout, then casting a T* you get from this class to a
* CachelinePadded<T>* is safe.
*
* This class handles padding, but imperfectly handles alignment. (Note that
* alignment matters for false-sharing: imagine a cacheline size of 64, and two
* adjacent 64-byte objects, with the first starting at an offset of 32. The
* last 32 bytes of the first object share a cacheline with the first 32 bytes
* of the second.). We alignas this class to be at least cacheline-sized, but
* it's implementation-defined what that means (since a cacheline is almost
* certainly larger than the maximum natural alignment). The following should be
* true for recent compilers on common architectures:
*
* For heap objects, alignment needs to be handled at the allocator level, such
* as with posix_memalign (this isn't necessary with jemalloc, which aligns
* objects that are a multiple of cacheline size to a cacheline).
</s> add * Holds a type T, in addition to enough padding to ensure that it isn't subject
* to false sharing within the range used by folly. </s> remove explicit ParameterizedDynamicTokenBucket(double zeroTime = 0) noexcept
</s> add explicit BasicDynamicTokenBucket(double zeroTime = 0) noexcept
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/TokenBucket.h
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> double nowInSeconds = defaultClockNow()) {
<mask> assert(rate > 0);
<mask> assert(burstSize > 0);
<mask>
<mask> return this->consumeImpl(
<mask> rate, burstSize, nowInSeconds, [toConsume](double& tokens) {
<mask> if (tokens < toConsume) {
<mask> return false;
<mask> }
<mask> tokens -= toConsume;
</s> [sdk33] Update iOS with RN 0.59 </s> remove this->consumeImpl(
</s> add consumeImpl( </s> remove double availTokens = available(nowInSeconds);
</s> add const double availTokens = available(nowInSeconds); </s> remove /**
* Returns the current time in seconds since Epoch.
*/
static double defaultClockNow() noexcept(noexcept(ClockT::timeSinceEpoch())) {
return std::chrono::duration_cast<std::chrono::duration<double>>(
ClockT::timeSinceEpoch())
.count();
}
</s> add </s> remove ParameterizedTokenBucket(
</s> add BasicTokenBucket( </s> remove for (; ht > 0 && less(data, node = pred->skip(ht - 1)); --ht) {}
if (ht == 0) return std::make_pair(node, 0); // not found
</s> add for (; ht > 0 && less(data, node = pred->skip(ht - 1)); --ht) {
}
if (ht == 0) {
return std::make_pair(node, 0); // not found
} </s> remove start.tv_nsec = start.tv_sec = 0;
</s> add start = {};
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/TokenBucket.h
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> assert(rate > 0);
<mask> assert(burstSize > 0);
<mask>
<mask> double consumed;
<mask> this->consumeImpl(
<mask> rate, burstSize, nowInSeconds, [&consumed, toConsume](double& tokens) {
<mask> if (tokens < toConsume) {
<mask> consumed = tokens;
<mask> tokens = 0.0;
<mask> } else {
</s> [sdk33] Update iOS with RN 0.59 </s> remove return this->consumeImpl(
</s> add return consumeImpl( </s> remove double availTokens = available(nowInSeconds);
</s> add const double availTokens = available(nowInSeconds); </s> remove ParameterizedTokenBucket(
</s> add BasicTokenBucket( </s> remove start.tv_nsec = start.tv_sec = 0;
</s> add start = {}; </s> remove detail::SkipListRandomHeight::instance()->getSizeLimit(hgt);
</s> add detail::SkipListRandomHeight::instance()->getSizeLimit(hgt); </s> remove assert(start.tv_nsec > 0 || start.tv_sec > 0);
</s> add assert(start != TimePoint{});
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/TokenBucket.h
|
keep keep keep keep replace replace replace replace replace replace replace replace replace keep keep keep keep keep
|
<mask>
<mask> return std::min((nowInSeconds - this->zeroTime_) * rate, burstSize);
<mask> }
<mask>
<mask> /**
<mask> * Returns the current time in seconds since Epoch.
<mask> */
<mask> static double defaultClockNow() noexcept(noexcept(ClockT::timeSinceEpoch())) {
<mask> return std::chrono::duration_cast<std::chrono::duration<double>>(
<mask> ClockT::timeSinceEpoch())
<mask> .count();
<mask> }
<mask>
<mask> private:
<mask> template <typename TCallback>
<mask> bool consumeImpl(
<mask> double rate,
<mask> double burstSize,
</s> [sdk33] Update iOS with RN 0.59 </s> remove /**
* Returns the current time in seconds since Epoch.
*/
static double defaultClockNow() noexcept(noexcept(Impl::defaultClockNow())) {
return Impl::defaultClockNow();
}
</s> add </s> remove ParameterizedTokenBucket& operator=(
const ParameterizedTokenBucket& other) noexcept = default;
</s> add BasicTokenBucket& operator=(const BasicTokenBucket& other) noexcept = default;
/**
* Returns the current time in seconds since Epoch.
*/
static double defaultClockNow() noexcept(noexcept(Impl::defaultClockNow())) {
return Impl::defaultClockNow();
} </s> add /**
* Returns the current time in seconds since Epoch.
*/
static double defaultClockNow() noexcept {
using dur = std::chrono::duration<double>;
auto const now = Clock::now().time_since_epoch();
return std::chrono::duration_cast<dur>(now).count();
}
</s> remove return this->consumeImpl(
</s> add return consumeImpl( </s> remove this->consumeImpl(
</s> add consumeImpl( </s> remove ParameterizedTokenBucket(
</s> add BasicTokenBucket(
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/TokenBucket.h
|
keep keep replace keep keep keep replace keep
|
<mask> }
<mask>
<mask> FOLLY_ALIGN_TO_AVOID_FALSE_SHARING std::atomic<double> zeroTime_;
<mask> };
<mask>
<mask> /**
<mask> * Specialization of ParameterizedDynamicTokenBucket with a fixed token
<mask> * generation rate and a fixed maximum burst size.
</s> [sdk33] Update iOS with RN 0.59 </s> remove template <typename ClockT = DefaultTokenBucketClock>
class ParameterizedTokenBucket {
</s> add template <typename Clock = std::chrono::steady_clock>
class BasicTokenBucket {
static_assert(Clock::is_steady, "clock must be steady");
</s> remove using Impl = ParameterizedDynamicTokenBucket<ClockT>;
</s> add using Impl = BasicDynamicTokenBucket<Clock>; </s> remove * @tparam ClockT Clock type, must be steady i.e. monotonic.
</s> add * @tparam Clock Clock type, must be steady i.e. monotonic. </s> remove /**
* Default clock class used by ParameterizedDynamicTokenBucket and derived
* classes. User-defined clock classes must be steady (monotonic) and define a
* static function std::chrono::duration<> timeSinceEpoch().
*/
struct DefaultTokenBucketClock {
static auto timeSinceEpoch() noexcept
-> decltype(std::chrono::steady_clock::now().time_since_epoch()) {
return std::chrono::steady_clock::now().time_since_epoch();
}
};
</s> add </s> remove ParameterizedTokenBucket& operator=(
const ParameterizedTokenBucket& other) noexcept = default;
</s> add BasicTokenBucket& operator=(const BasicTokenBucket& other) noexcept = default;
/**
* Returns the current time in seconds since Epoch.
*/
static double defaultClockNow() noexcept(noexcept(Impl::defaultClockNow())) {
return Impl::defaultClockNow();
}
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/TokenBucket.h
|
keep keep keep keep replace replace keep replace keep keep
|
<mask> /**
<mask> * Specialization of ParameterizedDynamicTokenBucket with a fixed token
<mask> * generation rate and a fixed maximum burst size.
<mask> */
<mask> template <typename ClockT = DefaultTokenBucketClock>
<mask> class ParameterizedTokenBucket {
<mask> private:
<mask> using Impl = ParameterizedDynamicTokenBucket<ClockT>;
<mask>
<mask> public:
</s> [sdk33] Update iOS with RN 0.59 </s> remove * Specialization of ParameterizedDynamicTokenBucket with a fixed token
</s> add * Specialization of BasicDynamicTokenBucket with a fixed token </s> remove FOLLY_ALIGN_TO_AVOID_FALSE_SHARING std::atomic<double> zeroTime_;
</s> add alignas(hardware_destructive_interference_size) std::atomic<double> zeroTime_; </s> remove * @tparam ClockT Clock type, must be steady i.e. monotonic.
</s> add * @tparam Clock Clock type, must be steady i.e. monotonic. </s> remove template <typename ClockT = DefaultTokenBucketClock>
class ParameterizedDynamicTokenBucket {
</s> add template <typename Clock = std::chrono::steady_clock>
class BasicDynamicTokenBucket {
static_assert(Clock::is_steady, "clock must be steady");
</s> remove /**
* Default clock class used by ParameterizedDynamicTokenBucket and derived
* classes. User-defined clock classes must be steady (monotonic) and define a
* static function std::chrono::duration<> timeSinceEpoch().
*/
struct DefaultTokenBucketClock {
static auto timeSinceEpoch() noexcept
-> decltype(std::chrono::steady_clock::now().time_since_epoch()) {
return std::chrono::steady_clock::now().time_since_epoch();
}
};
</s> add
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/TokenBucket.h
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> * @param zeroTime Initial time at which to consider the token bucket
<mask> * starting to fill. Defaults to 0, so by default token
<mask> * bucket is "full" after construction.
<mask> */
<mask> ParameterizedTokenBucket(
<mask> double genRate,
<mask> double burstSize,
<mask> double zeroTime = 0) noexcept
<mask> : tokenBucket_(zeroTime), rate_(genRate), burstSize_(burstSize) {
<mask> assert(rate_ > 0);
</s> [sdk33] Update iOS with RN 0.59 </s> remove explicit ParameterizedDynamicTokenBucket(double zeroTime = 0) noexcept
</s> add explicit BasicDynamicTokenBucket(double zeroTime = 0) noexcept </s> remove template <typename ClockT = DefaultTokenBucketClock>
class ParameterizedDynamicTokenBucket {
</s> add template <typename Clock = std::chrono::steady_clock>
class BasicDynamicTokenBucket {
static_assert(Clock::is_steady, "clock must be steady");
</s> remove double availTokens = available(nowInSeconds);
</s> add const double availTokens = available(nowInSeconds); </s> add /**
* Returns the current time in seconds since Epoch.
*/
static double defaultClockNow() noexcept {
using dur = std::chrono::duration<double>;
auto const now = Clock::now().time_since_epoch();
return std::chrono::duration_cast<dur>(now).count();
}
</s> remove /**
* Returns the current time in seconds since Epoch.
*/
static double defaultClockNow() noexcept(noexcept(ClockT::timeSinceEpoch())) {
return std::chrono::duration_cast<std::chrono::duration<double>>(
ClockT::timeSinceEpoch())
.count();
}
</s> add </s> remove /**
* Returns the current time in seconds since Epoch.
*/
static double defaultClockNow() noexcept(noexcept(Impl::defaultClockNow())) {
return Impl::defaultClockNow();
}
</s> add
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/TokenBucket.h
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask> * Copy constructor.
<mask> *
<mask> * Warning: not thread safe!
<mask> */
<mask> ParameterizedTokenBucket(const ParameterizedTokenBucket& other) noexcept =
<mask> default;
<mask>
<mask> /**
<mask> * Copy-assignment operator.
<mask> *
<mask> * Warning: not thread safe!
</s> [sdk33] Update iOS with RN 0.59 </s> remove ParameterizedTokenBucket& operator=(
const ParameterizedTokenBucket& other) noexcept = default;
</s> add BasicTokenBucket& operator=(const BasicTokenBucket& other) noexcept = default;
/**
* Returns the current time in seconds since Epoch.
*/
static double defaultClockNow() noexcept(noexcept(Impl::defaultClockNow())) {
return Impl::defaultClockNow();
} </s> remove ParameterizedDynamicTokenBucket& operator=(
const ParameterizedDynamicTokenBucket& other) noexcept {
</s> add BasicDynamicTokenBucket& operator=(
const BasicDynamicTokenBucket& other) noexcept { </s> remove ParameterizedDynamicTokenBucket(
const ParameterizedDynamicTokenBucket& other) noexcept
</s> add BasicDynamicTokenBucket(const BasicDynamicTokenBucket& other) noexcept </s> add template <
typename LockPolicyType,
EnableIfSameUnlockPolicy<LockPolicyType>* = nullptr>
LockedPtr(LockedPtr<SynchronizedType, LockPolicyType>&& other) noexcept
: Base{std::move(other)} {} </s> remove explicit ParameterizedDynamicTokenBucket(double zeroTime = 0) noexcept
</s> add explicit BasicDynamicTokenBucket(double zeroTime = 0) noexcept </s> add template <
typename LockPolicyType,
EnableIfSameUnlockPolicy<LockPolicyType>* = nullptr>
LockedPtr& operator=(
LockedPtr<SynchronizedType, LockPolicyType>&& other) noexcept {
Base::operator=(std::move(other));
return *this;
}
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/TokenBucket.h
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask> * Copy-assignment operator.
<mask> *
<mask> * Warning: not thread safe!
<mask> */
<mask> ParameterizedTokenBucket& operator=(
<mask> const ParameterizedTokenBucket& other) noexcept = default;
<mask>
<mask> /**
<mask> * Change rate and burst size.
<mask> *
<mask> * Warning: not thread safe!
</s> [sdk33] Update iOS with RN 0.59 </s> remove ParameterizedTokenBucket(const ParameterizedTokenBucket& other) noexcept =
default;
</s> add BasicTokenBucket(const BasicTokenBucket& other) noexcept = default; </s> remove ParameterizedDynamicTokenBucket& operator=(
const ParameterizedDynamicTokenBucket& other) noexcept {
</s> add BasicDynamicTokenBucket& operator=(
const BasicDynamicTokenBucket& other) noexcept { </s> remove ParameterizedDynamicTokenBucket(
const ParameterizedDynamicTokenBucket& other) noexcept
</s> add BasicDynamicTokenBucket(const BasicDynamicTokenBucket& other) noexcept </s> add template <
typename LockPolicyType,
EnableIfSameUnlockPolicy<LockPolicyType>* = nullptr>
LockedPtr(LockedPtr<SynchronizedType, LockPolicyType>&& other) noexcept
: Base{std::move(other)} {} </s> remove using Impl = ParameterizedDynamicTokenBucket<ClockT>;
</s> add using Impl = BasicDynamicTokenBucket<Clock>; </s> remove FOLLY_ALIGN_TO_AVOID_FALSE_SHARING std::atomic<double> zeroTime_;
</s> add alignas(hardware_destructive_interference_size) std::atomic<double> zeroTime_;
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/TokenBucket.h
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> double burstSize,
<mask> double nowInSeconds = defaultClockNow()) noexcept {
<mask> assert(genRate > 0);
<mask> assert(burstSize > 0);
<mask> double availTokens = available(nowInSeconds);
<mask> rate_ = genRate;
<mask> burstSize_ = burstSize;
<mask> setCapacity(availTokens, nowInSeconds);
<mask> }
<mask>
</s> [sdk33] Update iOS with RN 0.59 </s> remove return this->consumeImpl(
</s> add return consumeImpl( </s> remove this->consumeImpl(
</s> add consumeImpl( </s> remove ParameterizedTokenBucket(
</s> add BasicTokenBucket( </s> remove /**
* Returns the current time in seconds since Epoch.
*/
static double defaultClockNow() noexcept(noexcept(Impl::defaultClockNow())) {
return Impl::defaultClockNow();
}
</s> add </s> remove /**
* Returns the current time in seconds since Epoch.
*/
static double defaultClockNow() noexcept(noexcept(ClockT::timeSinceEpoch())) {
return std::chrono::duration_cast<std::chrono::duration<double>>(
ClockT::timeSinceEpoch())
.count();
}
</s> add </s> remove SkipListRandomHeight() { initLookupTable(); }
</s> add SkipListRandomHeight() {
initLookupTable();
}
|
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
|
ios/Pods/Folly/folly/TokenBucket.h
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.