docstring_tokens
stringlengths
18
16.9k
code_tokens
stringlengths
75
1.81M
html_url
stringlengths
74
116
file_name
stringlengths
3
311
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/portability/SysStat.h
keep keep keep add keep keep keep keep keep keep
<mask> <mask> #include <sys/stat.h> <mask> <mask> #ifdef _WIN32 <mask> // Windows gives weird names to these. <mask> #define S_IXUSR 0 <mask> #define S_IWUSR _S_IWRITE <mask> #define S_IRUSR _S_IREAD <mask> // No group/other permissions so default to user. <mask> #define S_IXGRP S_IXUSR </s> [sdk33] Update iOS with RN 0.59 </s> add #include <folly/portability/Windows.h> </s> add #define PRIO_PROCESS 1 </s> add #define S_ISDIR(mode) (((mode) & (_S_IFDIR)) == (_S_IFDIR) ? 1 : 0) </s> remove #include <basetsd.h> </s> add #include <basetsd.h> // @manual </s> remove #include <folly/portability/TypeTraits.h> </s> add #if (FOLLY_X64 || FOLLY_PPC64) #define FOLLY_SV_PACK_ATTR FOLLY_PACK_ATTR #define FOLLY_SV_PACK_PUSH FOLLY_PACK_PUSH #define FOLLY_SV_PACK_POP FOLLY_PACK_POP #else #define FOLLY_SV_PACK_ATTR #define FOLLY_SV_PACK_PUSH #define FOLLY_SV_PACK_POP #endif </s> add // these are not supported #define SO_EE_ORIGIN_ZEROCOPY 0 #define SO_ZEROCOPY 0 #define MSG_ZEROCOPY 0x0 #define SOL_UDP 0x0 #define UDP_SEGMENT 0x0
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/portability/SysStat.h
keep keep add keep keep keep keep keep
<mask> #define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR) <mask> #define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP) <mask> <mask> // This isn't defined anywhere, so give a sane value. <mask> #define MAXSYMLINKS 255 <mask> <mask> extern "C" { <mask> int chmod(char const* fn, int am); </s> [sdk33] Update iOS with RN 0.59 </s> add int fchmod(int fd, mode_t mode); </s> remove setFlags(getFlags() | FULLY_LINKED); </s> add setFlags(uint16_t(getFlags() | FULLY_LINKED)); </s> remove setFlags(getFlags() | MARKED_FOR_REMOVAL); </s> add setFlags(uint16_t(getFlags() | MARKED_FOR_REMOVAL)); </s> remove extern "C" { </s> add </s> remove setFlags(getFlags() | IS_HEAD_NODE); </s> add setFlags(uint16_t(getFlags() | IS_HEAD_NODE)); </s> add #define AF_LOCAL PF_UNIX
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/portability/SysStat.h
keep keep add keep keep keep keep keep
<mask> <mask> extern "C" { <mask> int chmod(char const* fn, int am); <mask> int lstat(const char* path, struct stat* st); <mask> int mkdir(const char* fn, int mode); <mask> int umask(int md); <mask> } <mask> #endif </s> [sdk33] Update iOS with RN 0.59 </s> add #define S_ISDIR(mode) (((mode) & (_S_IFDIR)) == (_S_IFDIR) ? 1 : 0) </s> remove size_t sysconf(int tp); long tell(int fh); </s> add long sysconf(int tp); </s> remove } } } </s> add } // namespace fcntl } // namespace portability } // namespace folly </s> remove extern "C" { </s> add </s> remove int setmode(int fh, int md); </s> add </s> add int getpriority(int which, int who); int setpriority(int which, int who, int value);
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/portability/SysStat.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/portability/SysSyscall.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/portability/SysTime.h
keep keep keep keep replace keep keep keep keep
<mask> int tz_dsttime; <mask> }; <mask> <mask> extern "C" { <mask> int gettimeofday(timeval* tv, timezone*); <mask> void timeradd(timeval* a, timeval* b, timeval* res); <mask> void timersub(timeval* a, timeval* b, timeval* res); <mask> } <mask> #endif </s> [sdk33] Update iOS with RN 0.59 </s> add int getpriority(int which, int who); int setpriority(int which, int who, int value); </s> add int fchmod(int fd, mode_t mode); </s> add #if !defined(_WIN32) #include <strings.h> #endif </s> remove template<class T, std::size_t MaxInline, class A, class B, class C> void swap(small_vector<T,MaxInline,A,B,C>& a, small_vector<T,MaxInline,A,B,C>& b) { </s> add template <class T, std::size_t MaxInline, class A, class B, class C> void swap( small_vector<T, MaxInline, A, B, C>& a, small_vector<T, MaxInline, A, B, C>& b) { </s> remove extern "C" { </s> add </s> remove char* strptime(const char* __restrict buf, const char* __restrict fmt, struct tm* __restrict tm); </s> add char* strptime( const char* __restrict buf, const char* __restrict fmt, struct tm* __restrict tm);
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/portability/SysTime.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/portability/SysTypes.h
keep keep keep replace keep keep keep replace replace replace keep keep keep
<mask> #include <sys/types.h> <mask> <mask> #ifdef _WIN32 <mask> #include <basetsd.h> <mask> <mask> #define HAVE_MODE_T 1 <mask> <mask> // This is actually defined in our pthread implementation on <mask> // Windows, but we don't want to include all of that just for this. <mask> using pid_t = void*; <mask> // This isn't actually supposed to be defined here, but it's the most <mask> // appropriate place without defining a portability header for stdint.h <mask> // with just this single typedef. </s> [sdk33] Update iOS with RN 0.59 </s> add #if defined(__APPLE__) #if __has_include(<crt_externs.h>) #include <crt_externs.h> // @manual #endif #endif extern "C" { </s> add #define AF_LOCAL PF_UNIX </s> add #include <folly/portability/Windows.h> </s> remove #ifdef CAL_GREGORIAN #undef CAL_GREGORIAN </s> add // This is needed because, for some absurd reason, one of the windows headers // tries to define "min" and "max" as macros, which messes up most uses of // std::numeric_limits. #ifndef NOMINMAX #define NOMINMAX 1 </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
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/portability/SysTypes.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/portability/SysUio.h
keep keep keep keep replace
<mask> constexpr size_t kIovMax = IOV_MAX; <mask> #else <mask> constexpr size_t kIovMax = UIO_MAXIOV; <mask> #endif <mask> } </s> [sdk33] Update iOS with RN 0.59 </s> remove #elif defined(_MSC_VER) return s == nullptr ? 0 : constexpr_strlen_internal(s, 0); #else </s> add #elif defined(__GNUC__) && !defined(__clang__) // strlen() happens to already be constexpr under gcc </s> remove static_assert(constexpr_strlen_internal("123456789", 0) == 9, "Someone appears to have broken constexpr_strlen..."); #endif </s> add </s> remove #if defined(__clang__) </s> add #if FOLLY_HAS_FEATURE(cxx_constexpr_string_builtins) // clang provides a constexpr builtin </s> remove #ifdef _MSC_VER constexpr size_t constexpr_strlen_internal(const char* s, size_t len) { return *s == '\0' ? len : constexpr_strlen_internal(s + 1, len + 1); </s> add template <typename Char> constexpr size_t constexpr_strlen(const Char* s) { return detail::constexpr_strlen_internal(s, 0); </s> add template <> </s> add #else return detail::constexpr_strlen_internal(s, 0);
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/portability/SysUio.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/portability/Syslog.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/portability/Time.h
keep keep keep keep replace replace replace keep keep
<mask> char* ctime_r(const time_t* t, char* buf); <mask> tm* gmtime_r(const time_t* t, tm* res); <mask> tm* localtime_r(const time_t* t, tm* o); <mask> int nanosleep(const struct timespec* request, struct timespec* remain); <mask> char* strptime(const char* __restrict buf, <mask> const char* __restrict fmt, <mask> struct tm* __restrict tm); <mask> } <mask> #endif </s> [sdk33] Update iOS with RN 0.59 </s> add int fchmod(int fd, mode_t mode); </s> remove } </s> add int setenv(const char* name, const char* value, int overwrite); int unsetenv(const char* name); #elif defined(__APPLE__) // environ doesn't work well with dylibs, so use _NSGetEnviron instead. #if !__has_include(<crt_externs.h>) char*** _NSGetEnviron(void); #endif #define environ (*_NSGetEnviron()) </s> remove size_t sysconf(int tp); long tell(int fh); </s> add long sysconf(int tp); </s> remove int setmode(int fh, int md); </s> add </s> remove long lseek(int fh, long off, int orig); int read(int fh, void* buf, unsigned int mcc); </s> add off_t lseek(int fh, off_t off, int orig); ssize_t read(int fh, void* buf, size_t mcc); </s> remove int pread(int fd, void* buf, size_t count, off_t offset); int pwrite(int fd, const void* buf, size_t count, off_t offset); </s> add ssize_t pread(int fd, void* buf, size_t count, off_t offset); ssize_t pwrite(int fd, const void* buf, size_t count, off_t offset);
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/portability/Time.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/portability/Unistd.h
keep keep keep keep replace keep keep keep keep keep
<mask> #ifndef _WIN32 <mask> #include <unistd.h> <mask> #else <mask> #include <cstdint> <mask> #include <sys/locking.h> <mask> #include <folly/portability/SysTypes.h> <mask> <mask> // This is different from the normal headers because there are a few cases, <mask> // such as close(), where we need to override the definition of an existing <mask> // function. To avoid conflicts at link time, everything here is in a namespace </s> [sdk33] Update iOS with RN 0.59 </s> add #if defined(__APPLE__) #if __has_include(<crt_externs.h>) #include <crt_externs.h> // @manual #endif #endif extern "C" { </s> remove #ifdef CAL_GREGORIAN #undef CAL_GREGORIAN </s> add // This is needed because, for some absurd reason, one of the windows headers // tries to define "min" and "max" as macros, which messes up most uses of // std::numeric_limits. #ifndef NOMINMAX #define NOMINMAX 1 </s> remove #include <basetsd.h> </s> add #include <basetsd.h> // @manual </s> remove // This is actually defined in our pthread implementation on // Windows, but we don't want to include all of that just for this. using pid_t = void*; </s> add // This is a massive pain to have be an `int` due to the pthread implementation // we support, but it's far more compatible with the rest of the windows world // as an `int` than it would be as a `void*` using pid_t = int; </s> remove #ifdef FOLLY_HAVE_BITS_CXXCONFIG_H </s> add #if __has_include(<bits/c++config.h>) </s> add #include <folly/Portability.h> // Disable a couple of warnings due to GTest exporting classes // that derive from stdlib classes which aren't explicitly exported. FOLLY_PUSH_WARNING FOLLY_MSVC_DISABLE_WARNING(4251) FOLLY_MSVC_DISABLE_WARNING(4275)
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/portability/Unistd.h
keep keep replace replace keep keep replace replace keep keep
<mask> int isatty(int fh); <mask> int lockf(int fd, int cmd, off_t len); <mask> long lseek(int fh, long off, int orig); <mask> int read(int fh, void* buf, unsigned int mcc); <mask> int rmdir(const char* path); <mask> int pipe(int pth[2]); <mask> int pread(int fd, void* buf, size_t count, off_t offset); <mask> int pwrite(int fd, const void* buf, size_t count, off_t offset); <mask> ssize_t readlink(const char* path, char* buf, size_t buflen); <mask> int setmode(int fh, int md); </s> [sdk33] Update iOS with RN 0.59 </s> remove int setmode(int fh, int md); </s> add </s> remove size_t sysconf(int tp); long tell(int fh); </s> add long sysconf(int tp); </s> remove int write(int fh, void const* buf, unsigned int mcc); } } } </s> add ssize_t write(int fh, void const* buf, size_t count); } // namespace unistd } // namespace portability } // namespace folly </s> remove } } } </s> add } // namespace fcntl } // namespace portability } // namespace folly </s> add int fchmod(int fd, mode_t mode);
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/portability/Unistd.h
keep replace keep keep replace replace keep keep
<mask> ssize_t readlink(const char* path, char* buf, size_t buflen); <mask> int setmode(int fh, int md); <mask> void* sbrk(intptr_t i); <mask> unsigned int sleep(unsigned int seconds); <mask> size_t sysconf(int tp); <mask> long tell(int fh); <mask> int truncate(const char* path, off_t len); <mask> int usleep(unsigned int ms); </s> [sdk33] Update iOS with RN 0.59 </s> remove int pread(int fd, void* buf, size_t count, off_t offset); int pwrite(int fd, const void* buf, size_t count, off_t offset); </s> add ssize_t pread(int fd, void* buf, size_t count, off_t offset); ssize_t pwrite(int fd, const void* buf, size_t count, off_t offset); </s> remove int write(int fh, void const* buf, unsigned int mcc); } } } </s> add ssize_t write(int fh, void const* buf, size_t count); } // namespace unistd } // namespace portability } // namespace folly </s> remove long lseek(int fh, long off, int orig); int read(int fh, void* buf, unsigned int mcc); </s> add off_t lseek(int fh, off_t off, int orig); ssize_t read(int fh, void* buf, size_t mcc); </s> add int fchmod(int fd, mode_t mode); </s> remove } </s> add int setenv(const char* name, const char* value, int overwrite); int unsetenv(const char* name); #elif defined(__APPLE__) // environ doesn't work well with dylibs, so use _NSGetEnviron instead. #if !__has_include(<crt_externs.h>) char*** _NSGetEnviron(void); #endif #define environ (*_NSGetEnviron())
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/portability/Unistd.h
keep keep keep keep replace replace replace replace keep keep keep
<mask> size_t sysconf(int tp); <mask> long tell(int fh); <mask> int truncate(const char* path, off_t len); <mask> int usleep(unsigned int ms); <mask> int write(int fh, void const* buf, unsigned int mcc); <mask> } <mask> } <mask> } <mask> <mask> /* using override */ using namespace folly::portability::unistd; <mask> #endif </s> [sdk33] Update iOS with RN 0.59 </s> remove size_t sysconf(int tp); long tell(int fh); </s> add long sysconf(int tp); </s> remove int setmode(int fh, int md); </s> add </s> remove long lseek(int fh, long off, int orig); int read(int fh, void* buf, unsigned int mcc); </s> add off_t lseek(int fh, off_t off, int orig); ssize_t read(int fh, void* buf, size_t mcc); </s> remove int pread(int fd, void* buf, size_t count, off_t offset); int pwrite(int fd, const void* buf, size_t count, off_t offset); </s> add ssize_t pread(int fd, void* buf, size_t count, off_t offset); ssize_t pwrite(int fd, const void* buf, size_t count, off_t offset); </s> remove } } } </s> add } // namespace fcntl } // namespace portability } // namespace folly </s> add int fchmod(int fd, mode_t mode);
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/portability/Unistd.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/portability/Windows.h
keep keep keep keep replace replace keep keep keep keep keep
<mask> // sockets at all. <mask> #ifndef __STDC__ <mask> /* nolint */ <mask> #define __STDC__ 1 <mask> #include <io.h> // nolint <mask> #include <direct.h> // nolint <mask> #undef __STDC__ <mask> #else <mask> #include <io.h> // nolint <mask> #include <direct.h> // nolint <mask> #endif </s> [sdk33] Update iOS with RN 0.59 </s> remove #include <io.h> // nolint #include <direct.h> // nolint </s> add #include <direct.h> // @manual nolint #include <io.h> // @manual nolint </s> remove #include <WinSock2.h> #include <Windows.h> </s> add #if defined(min) || defined(max) #error Windows.h needs to be included by this header, or else NOMINMAX needs \ to be defined before including it yourself. #endif </s> remove # define __GNUC_PREREQ(maj, min) ((__GNUC__ << 16) + __GNUC_MINOR__ >= \ ((maj) << 16) + (min)) # else </s> add #define __GNUC_PREREQ(maj, min) \ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) #else </s> add #include <folly/portability/Config.h> </s> remove # if defined __GNUC__ && defined __GNUC_MINOR__ </s> add #if defined __GNUC__ && defined __GNUC_MINOR__ </s> remove #ifdef CAL_GREGORIAN #undef CAL_GREGORIAN </s> add // This is needed because, for some absurd reason, one of the windows headers // tries to define "min" and "max" as macros, which messes up most uses of // std::numeric_limits. #ifndef NOMINMAX #define NOMINMAX 1
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/portability/Windows.h
keep keep replace replace keep keep replace replace keep keep keep keep
<mask> #undef __STDC__ <mask> #else <mask> #include <io.h> // nolint <mask> #include <direct.h> // nolint <mask> #endif <mask> <mask> #include <WinSock2.h> <mask> #include <Windows.h> <mask> <mask> #ifdef CAL_GREGORIAN <mask> #undef CAL_GREGORIAN <mask> #endif </s> [sdk33] Update iOS with RN 0.59 </s> remove #include <io.h> // nolint #include <direct.h> // nolint </s> add #include <direct.h> // @manual nolint #include <io.h> // @manual nolint </s> remove // Defined in winnt.h #ifdef DELETE #undef DELETE </s> add #include <WinSock2.h> // @manual #include <Windows.h> // @manual #ifdef CAL_GREGORIAN #undef CAL_GREGORIAN </s> remove #ifdef CAL_GREGORIAN #undef CAL_GREGORIAN </s> add // This is needed because, for some absurd reason, one of the windows headers // tries to define "min" and "max" as macros, which messes up most uses of // std::numeric_limits. #ifndef NOMINMAX #define NOMINMAX 1 </s> remove #include <android/api-level.h> </s> add #include <android/api-level.h> // @manual </s> remove #if FOLLY_HAVE_FEATURES_H #include <features.h> </s> add #if __has_include(<features.h>) #include <features.h> // @manual
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/portability/Windows.h
keep keep keep keep replace replace keep keep replace replace replace
<mask> <mask> #include <WinSock2.h> <mask> #include <Windows.h> <mask> <mask> #ifdef CAL_GREGORIAN <mask> #undef CAL_GREGORIAN <mask> #endif <mask> <mask> // Defined in winnt.h <mask> #ifdef DELETE <mask> #undef DELETE </s> [sdk33] Update iOS with RN 0.59 </s> remove #include <WinSock2.h> #include <Windows.h> </s> add #if defined(min) || defined(max) #error Windows.h needs to be included by this header, or else NOMINMAX needs \ to be defined before including it yourself. #endif </s> remove #include <io.h> // nolint #include <direct.h> // nolint </s> add #include <direct.h> // @manual nolint #include <io.h> // @manual nolint </s> remove #include <android/api-level.h> </s> add #include <android/api-level.h> // @manual </s> remove #if FOLLY_HAVE_FEATURES_H #include <features.h> </s> add #if __has_include(<features.h>) #include <features.h> // @manual </s> remove #include <vector> #include <boost/type_traits.hpp> #include <boost/regex/pending/unicode_iterator.hpp> #ifdef FOLLY_HAVE_DEPRECATED_ASSOC #ifdef _GLIBCXX_SYMVER #include <ext/hash_set> #include <ext/hash_map> #endif #endif #include <unordered_set> </s> add
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/portability/Windows.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/small_vector.h
keep keep replace replace replace keep replace keep keep
<mask> #pragma once <mask> <mask> #include <stdexcept> <mask> #include <cstdlib> <mask> #include <type_traits> <mask> #include <algorithm> <mask> #include <iterator> <mask> #include <cassert> <mask> </s> [sdk33] Update iOS with RN 0.59 </s> add #include <cassert> </s> add #include <cstdlib> #include <cstring> #include <iterator> #include <stdexcept> #include <type_traits> #include <utility> </s> remove #include <boost/iterator/iterator_facade.hpp> </s> add #include <iterator> #include <type_traits> #include <utility> </s> add #include <cstdint> </s> remove #include <boost/operators.hpp> #include <boost/type_traits.hpp> #include <boost/mpl/if.hpp> </s> add #include <boost/mpl/count.hpp> #include <boost/mpl/empty.hpp>
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep add keep keep keep keep
<mask> #include <algorithm> <mask> #include <cassert> <mask> <mask> #include <boost/mpl/count.hpp> <mask> #include <boost/mpl/empty.hpp> <mask> #include <boost/mpl/eval_if.hpp> </s> [sdk33] Update iOS with RN 0.59 </s> remove #include <boost/operators.hpp> #include <boost/type_traits.hpp> #include <boost/mpl/if.hpp> </s> add #include <boost/mpl/count.hpp> #include <boost/mpl/empty.hpp> </s> add #include <boost/mpl/front.hpp> </s> remove #include <boost/mpl/empty.hpp> </s> add </s> remove #include <boost/mpl/vector.hpp> #include <boost/mpl/front.hpp> </s> add </s> remove #include <boost/mpl/count.hpp> </s> add #include <boost/mpl/vector.hpp> #include <boost/operators.hpp> </s> add #include <cassert>
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep replace replace replace keep replace replace keep
<mask> <mask> #include <boost/operators.hpp> <mask> #include <boost/type_traits.hpp> <mask> #include <boost/mpl/if.hpp> <mask> #include <boost/mpl/eval_if.hpp> <mask> #include <boost/mpl/vector.hpp> <mask> #include <boost/mpl/front.hpp> <mask> #include <boost/mpl/filter_view.hpp> </s> [sdk33] Update iOS with RN 0.59 </s> add #include <boost/mpl/if.hpp> </s> add #include <boost/mpl/front.hpp> </s> remove #include <iterator> </s> add </s> remove #include <boost/mpl/empty.hpp> </s> add </s> add #include <folly/ConstexprMath.h>
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep add keep keep keep keep keep
<mask> #include <boost/mpl/count.hpp> <mask> #include <boost/mpl/empty.hpp> <mask> #include <boost/mpl/eval_if.hpp> <mask> #include <boost/mpl/filter_view.hpp> <mask> #include <boost/mpl/identity.hpp> <mask> #include <boost/mpl/if.hpp> <mask> #include <boost/mpl/placeholders.hpp> <mask> #include <boost/mpl/size.hpp> <mask> #include <boost/mpl/vector.hpp> </s> [sdk33] Update iOS with RN 0.59 </s> remove #include <boost/mpl/vector.hpp> #include <boost/mpl/front.hpp> </s> add </s> add #include <boost/mpl/if.hpp> </s> remove #include <boost/operators.hpp> #include <boost/type_traits.hpp> #include <boost/mpl/if.hpp> </s> add #include <boost/mpl/count.hpp> #include <boost/mpl/empty.hpp> </s> remove #include <boost/mpl/empty.hpp> </s> add </s> remove #include <boost/mpl/count.hpp> </s> add #include <boost/mpl/vector.hpp> #include <boost/operators.hpp> </s> add #include <cstdlib> #include <cstring> #include <iterator> #include <stdexcept> #include <type_traits> #include <utility>
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep add keep keep keep keep
<mask> #include <boost/mpl/eval_if.hpp> <mask> #include <boost/mpl/filter_view.hpp> <mask> #include <boost/mpl/front.hpp> <mask> #include <boost/mpl/identity.hpp> <mask> #include <boost/mpl/placeholders.hpp> <mask> #include <boost/mpl/size.hpp> <mask> #include <boost/mpl/vector.hpp> <mask> #include <boost/operators.hpp> </s> [sdk33] Update iOS with RN 0.59 </s> remove #include <boost/mpl/vector.hpp> #include <boost/mpl/front.hpp> </s> add </s> add #include <boost/mpl/front.hpp> </s> remove #include <boost/operators.hpp> #include <boost/type_traits.hpp> #include <boost/mpl/if.hpp> </s> add #include <boost/mpl/count.hpp> #include <boost/mpl/empty.hpp> </s> remove #include <boost/mpl/empty.hpp> </s> add </s> remove #include <boost/mpl/count.hpp> </s> add #include <boost/mpl/vector.hpp> #include <boost/operators.hpp> </s> add #include <folly/ConstexprMath.h>
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep replace keep replace
<mask> #include <boost/mpl/filter_view.hpp> <mask> #include <boost/mpl/identity.hpp> <mask> #include <boost/mpl/placeholders.hpp> <mask> #include <boost/mpl/empty.hpp> <mask> #include <boost/mpl/size.hpp> <mask> #include <boost/mpl/count.hpp> </s> [sdk33] Update iOS with RN 0.59 </s> add #include <boost/mpl/front.hpp> </s> remove #include <boost/mpl/vector.hpp> #include <boost/mpl/front.hpp> </s> add </s> add #include <boost/mpl/if.hpp> </s> remove #include <boost/operators.hpp> #include <boost/type_traits.hpp> #include <boost/mpl/if.hpp> </s> add #include <boost/mpl/count.hpp> #include <boost/mpl/empty.hpp> </s> remove #include <folly/Malloc.h> </s> add #include <folly/Likely.h>
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep add keep keep keep keep
<mask> #include <boost/mpl/vector.hpp> <mask> #include <boost/operators.hpp> <mask> <mask> #include <folly/FormatTraits.h> <mask> #include <folly/Likely.h> <mask> #include <folly/Portability.h> <mask> #include <folly/Traits.h> </s> [sdk33] Update iOS with RN 0.59 </s> remove #include <boost/mpl/count.hpp> </s> add #include <boost/mpl/vector.hpp> #include <boost/operators.hpp> </s> remove #include <folly/Malloc.h> </s> add #include <folly/Likely.h> </s> remove #include <folly/SmallLocks.h> #include <folly/portability/BitsFunctexcept.h> #include <folly/portability/Constexpr.h> </s> add #include <folly/Traits.h> #include <folly/lang/Assume.h> #include <folly/lang/Exception.h> #include <folly/memory/Malloc.h> </s> add #include <boost/mpl/if.hpp> </s> remove #include <boost/mpl/vector.hpp> #include <boost/mpl/front.hpp> </s> add </s> remove #include <boost/operators.hpp> #include <boost/type_traits.hpp> #include <boost/mpl/if.hpp> </s> add #include <boost/mpl/count.hpp> #include <boost/mpl/empty.hpp>
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep keep replace keep replace replace replace
<mask> #include <boost/mpl/size.hpp> <mask> #include <boost/mpl/count.hpp> <mask> <mask> #include <folly/FormatTraits.h> <mask> #include <folly/Malloc.h> <mask> #include <folly/Portability.h> <mask> #include <folly/SmallLocks.h> <mask> #include <folly/portability/BitsFunctexcept.h> <mask> #include <folly/portability/Constexpr.h> </s> [sdk33] Update iOS with RN 0.59 </s> remove #include <boost/mpl/count.hpp> </s> add #include <boost/mpl/vector.hpp> #include <boost/operators.hpp> </s> remove #include <boost/mpl/empty.hpp> </s> add </s> add #include <boost/mpl/front.hpp> </s> add #include <folly/ConstexprMath.h> </s> remove #include <folly/portability/TypeTraits.h> </s> add #if (FOLLY_X64 || FOLLY_PPC64) #define FOLLY_SV_PACK_ATTR FOLLY_PACK_ATTR #define FOLLY_SV_PACK_PUSH FOLLY_PACK_PUSH #define FOLLY_SV_PACK_POP FOLLY_PACK_POP #else #define FOLLY_SV_PACK_ATTR #define FOLLY_SV_PACK_PUSH #define FOLLY_SV_PACK_POP #endif
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep replace keep keep replace replace keep keep keep keep
<mask> #include <folly/portability/Constexpr.h> <mask> #include <folly/portability/Malloc.h> <mask> #include <folly/portability/TypeTraits.h> <mask> <mask> // Ignore shadowing warnings within this file, so includers can use -Wshadow. <mask> #pragma GCC diagnostic push <mask> #pragma GCC diagnostic ignored "-Wshadow" <mask> <mask> namespace folly { <mask> <mask> ////////////////////////////////////////////////////////////////////// </s> [sdk33] Update iOS with RN 0.59 </s> remove #include <folly/SmallLocks.h> #include <folly/portability/BitsFunctexcept.h> #include <folly/portability/Constexpr.h> </s> add #include <folly/Traits.h> #include <folly/lang/Assume.h> #include <folly/lang/Exception.h> #include <folly/memory/Malloc.h> </s> remove #include <folly/detail/ExceptionWrapper.h> </s> add #include <folly/FBString.h> #include <folly/Portability.h> #include <folly/Traits.h> #include <folly/Utility.h> #include <folly/lang/Assume.h> #ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wpragmas" #pragma GCC diagnostic ignored "-Wpotentially-evaluated-expression" // GCC gets confused about lambda scopes and issues shadow-local warnings for // parameters in totally different functions. FOLLY_GCC_DISABLE_NEW_SHADOW_WARNINGS #endif #define FOLLY_EXCEPTION_WRAPPER_H_INCLUDED </s> remove #pragma GCC diagnostic pop </s> add FOLLY_POP_WARNING </s> remove } // namespace folly </s> add } // namespace folly </s> remove } // namespace folly </s> add FOLLY_POP_WARNING
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep keep replace keep keep keep replace keep keep keep
<mask> struct NoHeap; <mask> <mask> ////////////////////////////////////////////////////////////////////// <mask> <mask> } // small_vector_policy <mask> <mask> ////////////////////////////////////////////////////////////////////// <mask> <mask> template<class T, std::size_t M, class A, class B, class C> <mask> class small_vector; <mask> <mask> ////////////////////////////////////////////////////////////////////// </s> [sdk33] Update iOS with RN 0.59 </s> remove template<class T, std::size_t MaxInline, class A, class B, class C> void swap(small_vector<T,MaxInline,A,B,C>& a, small_vector<T,MaxInline,A,B,C>& b) { </s> add template <class T, std::size_t MaxInline, class A, class B, class C> void swap( small_vector<T, MaxInline, A, B, C>& a, small_vector<T, MaxInline, A, B, C>& b) { </s> remove : public IndexableTraitsSeq<small_vector<T, M, A, B, C>> { }; </s> add : public IndexableTraitsSeq<small_vector<T, M, A, B, C>> {}; } // namespace detail </s> remove } </s> add } // namespace detail </s> add } // namespace detail </s> remove template<class Delim, class String, class OutputType> void split(const Delim& delimiter, const String& input, std::vector<OutputType>& out, bool ignoreEmpty) { </s> add template <class Delim, class String, class OutputType> void split( const Delim& delimiter, const String& input, std::vector<OutputType>& out, bool ignoreEmpty) {
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep keep replace replace replace replace keep keep keep keep keep
<mask> /* <mask> * Move a range to a range of uninitialized memory. Assumes the <mask> * ranges don't overlap. <mask> */ <mask> template<class T> <mask> typename std::enable_if< <mask> !FOLLY_IS_TRIVIALLY_COPYABLE(T) <mask> >::type <mask> moveToUninitialized(T* first, T* last, T* out) { <mask> std::size_t idx = 0; <mask> try { <mask> for (; first != last; ++first, ++idx) { <mask> new (&out[idx]) T(std::move(*first)); </s> [sdk33] Update iOS with RN 0.59 </s> remove * Move objects in memory to the right into some uninitialized * memory, where the region overlaps. This doesn't just use * std::move_backward because move_backward only works if all the * memory is initialized to type T already. </s> add * Move a range to a range of uninitialized memory. Assumes the * ranges don't overlap. Inserts an element at out + pos using * emplaceFunc(). out will contain (end - begin) + 1 elements on success and * none on failure. If emplaceFunc() throws [begin, end) is unmodified. </s> remove template<class T> typename std::enable_if< FOLLY_IS_TRIVIALLY_COPYABLE(T) >::type </s> add template <class T> typename std::enable_if<folly::is_trivially_copyable<T>::value>::type </s> remove } // Specialization for trivially copyable types. The call to // std::move_backward here will just turn into a memmove. (TODO: // change to std::is_trivially_copyable when that works.) template<class T> typename std::enable_if< FOLLY_IS_TRIVIALLY_COPYABLE(T) >::type moveObjectsRight(T* first, T* lastConstructed, T* realLast) { std::move_backward(first, lastConstructed, realLast); } /* * Populate a region of memory using `op' to construct elements. If * anything throws, undo what we did. */ template<class T, class Function> void populateMemForward(T* mem, std::size_t n, Function const& op) { std::size_t idx = 0; </s> add // move old elements to the right of the new one </s> remove template<class T> typename std::enable_if< !FOLLY_IS_TRIVIALLY_COPYABLE(T) >::type moveObjectsRight(T* first, T* lastConstructed, T* realLast) { if (lastConstructed == realLast) { return; } T* end = first - 1; // Past the end going backwards. T* out = realLast - 1; T* in = lastConstructed - 1; </s> add template <class T, class EmplaceFunc> void moveToUninitializedEmplace( T* begin, T* end, T* out, SizeType pos, EmplaceFunc&& emplaceFunc) { // Must be called first so that if it throws [begin, end) is unmodified. // We have to support the strong exception guarantee for emplace_back(). emplaceFunc(out + pos); // move old elements to the left of the new one </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 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(); } };
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep keep replace replace replace replace keep keep keep keep keep
<mask> } <mask> } <mask> <mask> // Specialization for trivially copyable types. <mask> template<class T> <mask> typename std::enable_if< <mask> FOLLY_IS_TRIVIALLY_COPYABLE(T) <mask> >::type <mask> moveToUninitialized(T* first, T* last, T* out) { <mask> std::memmove(out, first, (last - first) * sizeof *first); <mask> } <mask> <mask> /* </s> [sdk33] Update iOS with RN 0.59 </s> remove template<class T> typename std::enable_if< !FOLLY_IS_TRIVIALLY_COPYABLE(T) >::type </s> add template <class T> typename std::enable_if<!folly::is_trivially_copyable<T>::value>::type </s> remove } // Specialization for trivially copyable types. The call to // std::move_backward here will just turn into a memmove. (TODO: // change to std::is_trivially_copyable when that works.) template<class T> typename std::enable_if< FOLLY_IS_TRIVIALLY_COPYABLE(T) >::type moveObjectsRight(T* first, T* lastConstructed, T* realLast) { std::move_backward(first, lastConstructed, realLast); } /* * Populate a region of memory using `op' to construct elements. If * anything throws, undo what we did. */ template<class T, class Function> void populateMemForward(T* mem, std::size_t n, Function const& op) { std::size_t idx = 0; </s> add // move old elements to the right of the new one </s> remove * Move objects in memory to the right into some uninitialized * memory, where the region overlaps. This doesn't just use * std::move_backward because move_backward only works if all the * memory is initialized to type T already. </s> add * Move a range to a range of uninitialized memory. Assumes the * ranges don't overlap. Inserts an element at out + pos using * emplaceFunc(). out will contain (end - begin) + 1 elements on success and * none on failure. If emplaceFunc() throws [begin, end) is unmodified. </s> remove template<class T> typename std::enable_if< !FOLLY_IS_TRIVIALLY_COPYABLE(T) >::type moveObjectsRight(T* first, T* lastConstructed, T* realLast) { if (lastConstructed == realLast) { return; } T* end = first - 1; // Past the end going backwards. T* out = realLast - 1; T* in = lastConstructed - 1; </s> add template <class T, class EmplaceFunc> void moveToUninitializedEmplace( T* begin, T* end, T* out, SizeType pos, EmplaceFunc&& emplaceFunc) { // Must be called first so that if it throws [begin, end) is unmodified. // We have to support the strong exception guarantee for emplace_back(). emplaceFunc(out + pos); // move old elements to the left of the new one </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 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(); } };
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep keep replace replace replace replace keep replace replace replace replace replace replace replace replace replace replace replace replace keep keep
<mask> std::memmove(out, first, (last - first) * sizeof *first); <mask> } <mask> <mask> /* <mask> * Move objects in memory to the right into some uninitialized <mask> * memory, where the region overlaps. This doesn't just use <mask> * std::move_backward because move_backward only works if all the <mask> * memory is initialized to type T already. <mask> */ <mask> template<class T> <mask> typename std::enable_if< <mask> !FOLLY_IS_TRIVIALLY_COPYABLE(T) <mask> >::type <mask> moveObjectsRight(T* first, T* lastConstructed, T* realLast) { <mask> if (lastConstructed == realLast) { <mask> return; <mask> } <mask> <mask> T* end = first - 1; // Past the end going backwards. <mask> T* out = realLast - 1; <mask> T* in = lastConstructed - 1; <mask> try { <mask> for (; in != end && out >= lastConstructed; --in, --out) { </s> [sdk33] Update iOS with RN 0.59 </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 template<class T> typename std::enable_if< FOLLY_IS_TRIVIALLY_COPYABLE(T) >::type </s> add template <class T> typename std::enable_if<folly::is_trivially_copyable<T>::value>::type </s> remove } // Specialization for trivially copyable types. The call to // std::move_backward here will just turn into a memmove. (TODO: // change to std::is_trivially_copyable when that works.) template<class T> typename std::enable_if< FOLLY_IS_TRIVIALLY_COPYABLE(T) >::type moveObjectsRight(T* first, T* lastConstructed, T* realLast) { std::move_backward(first, lastConstructed, realLast); } /* * Populate a region of memory using `op' to construct elements. If * anything throws, undo what we did. */ template<class T, class Function> void populateMemForward(T* mem, std::size_t n, Function const& op) { std::size_t idx = 0; </s> add // move old elements to the right of the new one </s> remove template<class T> typename std::enable_if< !FOLLY_IS_TRIVIALLY_COPYABLE(T) >::type </s> add template <class T> typename std::enable_if<!folly::is_trivially_copyable<T>::value>::type </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();
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep replace replace replace replace replace replace replace replace replace keep replace replace replace replace replace replace replace replace replace keep
<mask> T* in = lastConstructed - 1; <mask> try { <mask> for (; in != end && out >= lastConstructed; --in, --out) { <mask> new (out) T(std::move(*in)); <mask> } <mask> for (; in != end; --in, --out) { <mask> *out = std::move(*in); <mask> } <mask> for (; out >= lastConstructed; --out) { <mask> new (out) T(); <mask> } <mask> } catch (...) { <mask> // We want to make sure the same stuff is uninitialized memory <mask> // if we exit via an exception (this is to make sure we provide <mask> // the basic exception safety guarantee for insert functions). <mask> if (out < lastConstructed) { <mask> out = lastConstructed - 1; <mask> } <mask> for (auto it = out + 1; it != realLast; ++it) { <mask> it->~T(); <mask> } <mask> throw; </s> [sdk33] Update iOS with RN 0.59 </s> remove template<class T> typename std::enable_if< !FOLLY_IS_TRIVIALLY_COPYABLE(T) >::type moveObjectsRight(T* first, T* lastConstructed, T* realLast) { if (lastConstructed == realLast) { return; } T* end = first - 1; // Past the end going backwards. T* out = realLast - 1; T* in = lastConstructed - 1; </s> add template <class T, class EmplaceFunc> void moveToUninitializedEmplace( T* begin, T* end, T* out, SizeType pos, EmplaceFunc&& emplaceFunc) { // Must be called first so that if it throws [begin, end) is unmodified. // We have to support the strong exception guarantee for emplace_back(). emplaceFunc(out + pos); // move old elements to the left of the new one </s> remove for (; b >= dest; --b) b->~T(); </s> add for (; b >= dest; --b) { b->~T(); } </s> remove // move old elements to the left of the new one try { detail::moveToUninitialized(begin(), begin() + pos, newp); } catch (...) { newp[pos].~value_type(); free(newh); throw; } // move old elements to the right of the new one try { if (pos < size-1) { detail::moveToUninitialized(begin() + pos, end(), newp + pos + 1); } } catch (...) { for (size_type i = 0; i <= pos; ++i) { newp[i].~value_type(); } free(newh); throw; } } else { // move without inserting new element try { detail::moveToUninitialized(begin(), end(), newp); } catch (...) { free(newh); throw; </s> add try { if (insert) { // move and insert the new element this->moveToUninitializedEmplace( begin(), end(), newp, pos, std::forward<EmplaceFunc>(emplaceFunc)); } else { // move without inserting new element this->moveToUninitialized(begin(), end(), newp); </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 (size_t i = 0; i < n; ++i) { op(&mem[idx]); ++idx; </s> add if (begin + pos < end) { this->moveToUninitialized(begin + pos, end, out + pos + 1);
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep replace replace replace
<mask> throw; <mask> } <mask> } <mask> <mask> // Specialization for trivially copyable types. The call to <mask> // std::move_backward here will just turn into a memmove. (TODO: <mask> // change to std::is_trivially_copyable when that works.) <mask> template<class T> <mask> typename std::enable_if< <mask> FOLLY_IS_TRIVIALLY_COPYABLE(T) <mask> >::type <mask> moveObjectsRight(T* first, T* lastConstructed, T* realLast) { <mask> std::move_backward(first, lastConstructed, realLast); <mask> } <mask> <mask> /* <mask> * Populate a region of memory using `op' to construct elements. If <mask> * anything throws, undo what we did. <mask> */ <mask> template<class T, class Function> <mask> void populateMemForward(T* mem, std::size_t n, Function const& op) { <mask> std::size_t idx = 0; <mask> try { <mask> for (size_t i = 0; i < n; ++i) { <mask> op(&mem[idx]); <mask> ++idx; </s> [sdk33] Update iOS with RN 0.59 </s> remove template<class T> typename std::enable_if< FOLLY_IS_TRIVIALLY_COPYABLE(T) >::type </s> add template <class T> typename std::enable_if<folly::is_trivially_copyable<T>::value>::type </s> remove template<class T> typename std::enable_if< !FOLLY_IS_TRIVIALLY_COPYABLE(T) >::type </s> add template <class T> typename std::enable_if<!folly::is_trivially_copyable<T>::value>::type </s> remove template<class T> typename std::enable_if< !FOLLY_IS_TRIVIALLY_COPYABLE(T) >::type moveObjectsRight(T* first, T* lastConstructed, T* realLast) { if (lastConstructed == realLast) { return; } T* end = first - 1; // Past the end going backwards. T* out = realLast - 1; T* in = lastConstructed - 1; </s> add template <class T, class EmplaceFunc> void moveToUninitializedEmplace( T* begin, T* end, T* out, SizeType pos, EmplaceFunc&& emplaceFunc) { // Must be called first so that if it throws [begin, end) is unmodified. // We have to support the strong exception guarantee for emplace_back(). emplaceFunc(out + pos); // move old elements to the left of the new one </s> remove for (std::size_t i = 0; i < idx; ++i) { mem[i].~T(); </s> add for (SizeType i = 0; i <= pos; ++i) { out[i].~T(); </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();
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep keep replace replace keep keep keep keep keep
<mask> op(&mem[idx]); <mask> ++idx; <mask> } <mask> } catch (...) { <mask> for (std::size_t i = 0; i < idx; ++i) { <mask> mem[i].~T(); <mask> } <mask> throw; <mask> } <mask> } <mask> </s> [sdk33] Update iOS with RN 0.59 </s> remove for (size_t i = 0; i < n; ++i) { op(&mem[idx]); ++idx; </s> add if (begin + pos < end) { this->moveToUninitialized(begin + pos, end, out + pos + 1); </s> remove // move old elements to the left of the new one try { detail::moveToUninitialized(begin(), begin() + pos, newp); } catch (...) { newp[pos].~value_type(); free(newh); throw; } // move old elements to the right of the new one try { if (pos < size-1) { detail::moveToUninitialized(begin() + pos, end(), newp + pos + 1); } } catch (...) { for (size_type i = 0; i <= pos; ++i) { newp[i].~value_type(); } free(newh); throw; } } else { // move without inserting new element try { detail::moveToUninitialized(begin(), end(), newp); } catch (...) { free(newh); throw; </s> add try { if (insert) { // move and insert the new element this->moveToUninitializedEmplace( begin(), end(), newp, pos, std::forward<EmplaceFunc>(emplaceFunc)); } else { // move without inserting new element this->moveToUninitialized(begin(), end(), newp); </s> remove for (int i = 0; i < node->height_; ++i) { </s> add for (uint8_t i = 0; i < node->height_; ++i) { </s> remove } // Specialization for trivially copyable types. The call to // std::move_backward here will just turn into a memmove. (TODO: // change to std::is_trivially_copyable when that works.) template<class T> typename std::enable_if< FOLLY_IS_TRIVIALLY_COPYABLE(T) >::type moveObjectsRight(T* first, T* lastConstructed, T* realLast) { std::move_backward(first, lastConstructed, realLast); } /* * Populate a region of memory using `op' to construct elements. If * anything throws, undo what we did. */ template<class T, class Function> void populateMemForward(T* mem, std::size_t n, Function const& op) { std::size_t idx = 0; </s> add // move old elements to the right of the new one </s> remove hints_[i] = i + 1; </s> add hints_[i] = uint8_t(i + 1); </s> remove if (isHead) setIsHeadNode(); </s> add if (isHead) { setIsHeadNode(); }
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep add keep keep keep keep keep keep
<mask> } <mask> throw; <mask> } <mask> } <mask> <mask> template <class SizeType> <mask> struct IntegralSizePolicy<SizeType, false> <mask> : public IntegralSizePolicyBase<SizeType, false> { <mask> public: <mask> template <class T> </s> [sdk33] Update iOS with RN 0.59 </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 // Older versions of libstdc++ do not provide std::is_trivially_copyable #if defined(__clang__) && !defined(_LIBCPP_VERSION) template <class T> struct is_trivially_copyable : std::integral_constant<bool, __is_trivially_copyable(T)> {}; #elif defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 5 template <class T> struct is_trivially_copyable : std::is_trivial<T> {}; #else template <class T> using is_trivially_copyable = std::is_trivially_copyable<T>; #endif } </s> add } // namespace traits_detail </s> add Ignore() = default; </s> remove /* implicit */ Ignore(const T&) {} </s> add constexpr /* implicit */ Ignore(const T&) {} </s> remove template <class T> T* pointerFlagSet(T* p) { return reinterpret_cast<T*>(reinterpret_cast<uintptr_t>(p) | 1); } template <class T> bool pointerFlagGet(T* p) { return reinterpret_cast<uintptr_t>(p) & 1; } template <class T> T* pointerFlagClear(T* p) { return reinterpret_cast<T*>( reinterpret_cast<uintptr_t>(p) & ~uintptr_t(1)); } inline void* shiftPointer(void* p, size_t sizeBytes) { return static_cast<char*>(p) + sizeBytes; } </s> add template <class T> T* pointerFlagSet(T* p) { return reinterpret_cast<T*>(reinterpret_cast<uintptr_t>(p) | 1); } template <class T> bool pointerFlagGet(T* p) { return reinterpret_cast<uintptr_t>(p) & 1; } template <class T> T* pointerFlagClear(T* p) { return reinterpret_cast<T*>(reinterpret_cast<uintptr_t>(p) & ~uintptr_t(1)); } inline void* shiftPointer(void* p, size_t sizeBytes) { return static_cast<char*>(p) + sizeBytes; </s> remove const Ignore& operator=(T const&) const { return *this; } </s> add const Ignore& operator=(T const&) const { return *this; }
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep 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 replace replace replace replace replace replace replace replace replace replace keep replace replace
<mask> } <mask> <mask> template<class SizeType, bool ShouldUseHeap> <mask> struct IntegralSizePolicy { <mask> typedef SizeType InternalSizeType; <mask> <mask> IntegralSizePolicy() : size_(0) {} <mask> <mask> protected: <mask> static constexpr std::size_t policyMaxSize() { <mask> return SizeType(~kExternMask); <mask> } <mask> <mask> std::size_t doSize() const { <mask> return size_ & ~kExternMask; <mask> } <mask> <mask> std::size_t isExtern() const { <mask> return kExternMask & size_; <mask> } <mask> <mask> void setExtern(bool b) { <mask> if (b) { <mask> size_ |= kExternMask; <mask> } else { <mask> size_ &= ~kExternMask; <mask> } <mask> } <mask> <mask> void setSize(std::size_t sz) { <mask> assert(sz <= policyMaxSize()); <mask> size_ = (kExternMask & size_) | SizeType(sz); <mask> } <mask> <mask> void swapSizePolicy(IntegralSizePolicy& o) { <mask> std::swap(size_, o.size_); <mask> } <mask> <mask> protected: <mask> static bool const kShouldUseHeap = ShouldUseHeap; <mask> <mask> private: <mask> static SizeType const kExternMask = <mask> kShouldUseHeap ? SizeType(1) << (sizeof(SizeType) * 8 - 1) <mask> : 0; <mask> <mask> SizeType size_; <mask> }; </s> [sdk33] Update iOS with RN 0.59 </s> remove bool fullyLinked() const { return getFlags() & FULLY_LINKED; } bool markedForRemoval() const { return getFlags() & MARKED_FOR_REMOVAL; } bool isHeadNode() const { return getFlags() & IS_HEAD_NODE; } </s> add bool fullyLinked() const { return getFlags() & FULLY_LINKED; } bool markedForRemoval() const { return getFlags() & MARKED_FOR_REMOVAL; } bool isHeadNode() const { return getFlags() & IS_HEAD_NODE; } </s> remove setFlags(getFlags() | IS_HEAD_NODE); </s> add setFlags(uint16_t(getFlags() | IS_HEAD_NODE)); </s> remove return kIsLittleEndian ? capacity_ & capacityExtractMask : capacity_ >> 2; </s> add return kIsLittleEndian ? capacity_ & capacityExtractMask : capacity_ >> 2; </s> remove : backend_(another.backend_) { } dummy_fbstring_core(const Char * s, size_t n) : backend_(s, n) { } void swap(dummy_fbstring_core & rhs) { </s> add : backend_(another.backend_) {} dummy_fbstring_core(const Char* s, size_t n) : backend_(s, n) {} void swap(dummy_fbstring_core& rhs) { </s> remove const Char * data() const { </s> add const Char* data() const {
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep replace replace replace replace replace replace replace replace replace keep replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep
<mask> <mask> /* <mask> * If you're just trying to use this class, ignore everything about <mask> * this next small_vector_base class thing. <mask> * <mask> * The purpose of this junk is to minimize sizeof(small_vector<>) <mask> * and allow specifying the template parameters in whatever order is <mask> * convenient for the user. There's a few extra steps here to try <mask> * to keep the error messages at least semi-reasonable. <mask> * <mask> * Apologies for all the black magic. <mask> */ <mask> namespace mpl = boost::mpl; <mask> template<class Value, <mask> std::size_t RequestedMaxInline, <mask> class InPolicyA, <mask> class InPolicyB, <mask> class InPolicyC> <mask> struct small_vector_base { <mask> typedef mpl::vector<InPolicyA,InPolicyB,InPolicyC> PolicyList; <mask> <mask> /* <mask> * Determine the size type <mask> */ <mask> typedef typename mpl::filter_view< <mask> PolicyList, <mask> boost::is_integral<mpl::placeholders::_1> <mask> >::type Integrals; <mask> typedef typename mpl::eval_if< </s> [sdk33] Update iOS with RN 0.59 </s> remove SizeType size_; }; </s> add /* * If you're just trying to use this class, ignore everything about * this next small_vector_base class thing. * * The purpose of this junk is to minimize sizeof(small_vector<>) * and allow specifying the template parameters in whatever order is * convenient for the user. There's a few extra steps here to try * to keep the error messages at least semi-reasonable. * * Apologies for all the black magic. */ namespace mpl = boost::mpl; template < class Value, std::size_t RequestedMaxInline, class InPolicyA, class InPolicyB, class InPolicyC> struct small_vector_base { typedef mpl::vector<InPolicyA, InPolicyB, InPolicyC> PolicyList; </s> remove boost::is_integral<mpl::placeholders::_1> >::type Integrals; typedef typename mpl::eval_if< </s> add std::is_integral<mpl::placeholders::_1>>::type Integrals; typedef typename mpl::eval_if< </s> remove /* * Now inherit from them all. This is done in such a convoluted * way to make sure we get the empty base optimizaton on all these * types to keep sizeof(small_vector<>) minimal. */ typedef boost::totally_ordered1< small_vector<Value,RequestedMaxInline,InPolicyA,InPolicyB,InPolicyC>, ActualSizePolicy > type; }; </s> add /* * Now inherit from them all. This is done in such a convoluted * way to make sure we get the empty base optimizaton on all these * types to keep sizeof(small_vector<>) minimal. */ typedef boost::totally_ordered1< small_vector<Value, RequestedMaxInline, InPolicyA, InPolicyB, InPolicyC>, ActualSizePolicy> type; }; </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 /* * Determine whether we should allow spilling to the heap or not. */ typedef typename mpl::count< PolicyList,small_vector_policy::NoHeap >::type HasNoHeap; </s> add /* * Determine whether we should allow spilling to the heap or not. */ typedef typename mpl::count<PolicyList, small_vector_policy::NoHeap>::type HasNoHeap;
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep replace replace replace keep keep replace replace keep keep
<mask> */ <mask> typedef typename mpl::filter_view< <mask> PolicyList, <mask> boost::is_integral<mpl::placeholders::_1> <mask> >::type Integrals; <mask> typedef typename mpl::eval_if< <mask> mpl::empty<Integrals>, <mask> mpl::identity<std::size_t>, <mask> mpl::front<Integrals> <mask> >::type SizeType; <mask> <mask> static_assert(std::is_unsigned<SizeType>::value, </s> [sdk33] Update iOS with RN 0.59 </s> remove namespace mpl = boost::mpl; template<class Value, std::size_t RequestedMaxInline, class InPolicyA, class InPolicyB, class InPolicyC> struct small_vector_base { typedef mpl::vector<InPolicyA,InPolicyB,InPolicyC> PolicyList; /* * Determine the size type */ typedef typename mpl::filter_view< </s> add typedef typename mpl::filter_view< </s> remove static_assert(std::is_unsigned<SizeType>::value, "Size type should be an unsigned integral type"); static_assert(mpl::size<Integrals>::value == 0 || mpl::size<Integrals>::value == 1, "Multiple size types specified in small_vector<>"); </s> add static_assert( std::is_unsigned<SizeType>::value, "Size type should be an unsigned integral type"); static_assert( mpl::size<Integrals>::value == 0 || mpl::size<Integrals>::value == 1, "Multiple size types specified in small_vector<>"); </s> remove sizeof(value_type) * MaxInline, alignof(value_type) >::type InlineStorageDataType; #endif </s> add sizeof(value_type) * MaxInline, alignof(value_type)>::type InlineStorageDataType; </s> remove #if (FOLLY_X64 || FOLLY_PPC64) typedef unsigned char InlineStorageDataType[sizeof(value_type) * MaxInline]; #else </s> add </s> remove typedef typename std::conditional< kHasInlineCapacity, HeapPtrWithCapacity, HeapPtr >::type PointerType; </s> add typedef typename std:: conditional<kHasInlineCapacity, HeapPtrWithCapacity, HeapPtr>::type PointerType;
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep keep replace replace replace replace replace keep replace replace replace replace replace replace
<mask> mpl::identity<std::size_t>, <mask> mpl::front<Integrals> <mask> >::type SizeType; <mask> <mask> static_assert(std::is_unsigned<SizeType>::value, <mask> "Size type should be an unsigned integral type"); <mask> static_assert(mpl::size<Integrals>::value == 0 || <mask> mpl::size<Integrals>::value == 1, <mask> "Multiple size types specified in small_vector<>"); <mask> <mask> /* <mask> * Determine whether we should allow spilling to the heap or not. <mask> */ <mask> typedef typename mpl::count< <mask> PolicyList,small_vector_policy::NoHeap <mask> >::type HasNoHeap; </s> [sdk33] Update iOS with RN 0.59 </s> remove mpl::front<Integrals> >::type SizeType; </s> add mpl::front<Integrals>>::type SizeType; </s> remove static_assert(HasNoHeap::value == 0 || HasNoHeap::value == 1, "Multiple copies of small_vector_policy::NoHeap " "supplied; this is probably a mistake"); </s> add static_assert( HasNoHeap::value == 0 || HasNoHeap::value == 1, "Multiple copies of small_vector_policy::NoHeap " "supplied; this is probably a mistake"); </s> remove boost::is_integral<mpl::placeholders::_1> >::type Integrals; typedef typename mpl::eval_if< </s> add std::is_integral<mpl::placeholders::_1>>::type Integrals; typedef typename mpl::eval_if< </s> remove /* * Make the real policy base classes. */ typedef IntegralSizePolicy<SizeType,!HasNoHeap::value> ActualSizePolicy; </s> add /* * Make the real policy base classes. */ typedef IntegralSizePolicy<SizeType, !HasNoHeap::value> ActualSizePolicy; </s> remove namespace mpl = boost::mpl; template<class Value, std::size_t RequestedMaxInline, class InPolicyA, class InPolicyB, class InPolicyC> struct small_vector_base { typedef mpl::vector<InPolicyA,InPolicyB,InPolicyC> PolicyList; /* * Determine the size type */ typedef typename mpl::filter_view< </s> add typedef typename mpl::filter_view<
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep replace replace replace keep replace replace replace replace replace keep
<mask> <mask> static_assert(HasNoHeap::value == 0 || HasNoHeap::value == 1, <mask> "Multiple copies of small_vector_policy::NoHeap " <mask> "supplied; this is probably a mistake"); <mask> <mask> /* <mask> * Make the real policy base classes. <mask> */ <mask> typedef IntegralSizePolicy<SizeType,!HasNoHeap::value> <mask> ActualSizePolicy; <mask> </s> [sdk33] Update iOS with RN 0.59 </s> remove /* * Determine whether we should allow spilling to the heap or not. */ typedef typename mpl::count< PolicyList,small_vector_policy::NoHeap >::type HasNoHeap; </s> add /* * Determine whether we should allow spilling to the heap or not. */ typedef typename mpl::count<PolicyList, small_vector_policy::NoHeap>::type HasNoHeap; </s> remove static_assert(std::is_unsigned<SizeType>::value, "Size type should be an unsigned integral type"); static_assert(mpl::size<Integrals>::value == 0 || mpl::size<Integrals>::value == 1, "Multiple size types specified in small_vector<>"); </s> add static_assert( std::is_unsigned<SizeType>::value, "Size type should be an unsigned integral type"); static_assert( mpl::size<Integrals>::value == 0 || mpl::size<Integrals>::value == 1, "Multiple size types specified in small_vector<>"); </s> remove /* * Now inherit from them all. This is done in such a convoluted * way to make sure we get the empty base optimizaton on all these * types to keep sizeof(small_vector<>) minimal. */ typedef boost::totally_ordered1< small_vector<Value,RequestedMaxInline,InPolicyA,InPolicyB,InPolicyC>, ActualSizePolicy > type; }; </s> add /* * Now inherit from them all. This is done in such a convoluted * way to make sure we get the empty base optimizaton on all these * types to keep sizeof(small_vector<>) minimal. */ typedef boost::totally_ordered1< small_vector<Value, RequestedMaxInline, InPolicyA, InPolicyB, InPolicyC>, ActualSizePolicy> type; }; </s> remove mpl::front<Integrals> >::type SizeType; </s> add mpl::front<Integrals>>::type SizeType; </s> remove /* * IsTriviallyCopyable describes the value semantics property. C++11 contains * the type trait is_trivially_copyable; however, it is not yet implemented * in gcc (as of 4.7.1), and the user may wish to specify otherwise. */ </s> add
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep replace replace replace replace replace replace replace replace replace replace keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace
<mask> typedef IntegralSizePolicy<SizeType,!HasNoHeap::value> <mask> ActualSizePolicy; <mask> <mask> /* <mask> * Now inherit from them all. This is done in such a convoluted <mask> * way to make sure we get the empty base optimizaton on all these <mask> * types to keep sizeof(small_vector<>) minimal. <mask> */ <mask> typedef boost::totally_ordered1< <mask> small_vector<Value,RequestedMaxInline,InPolicyA,InPolicyB,InPolicyC>, <mask> ActualSizePolicy <mask> > type; <mask> }; <mask> <mask> template <class T> <mask> T* pointerFlagSet(T* p) { <mask> return reinterpret_cast<T*>(reinterpret_cast<uintptr_t>(p) | 1); <mask> } <mask> template <class T> <mask> bool pointerFlagGet(T* p) { <mask> return reinterpret_cast<uintptr_t>(p) & 1; <mask> } <mask> template <class T> <mask> T* pointerFlagClear(T* p) { <mask> return reinterpret_cast<T*>( <mask> reinterpret_cast<uintptr_t>(p) & ~uintptr_t(1)); <mask> } <mask> inline void* shiftPointer(void* p, size_t sizeBytes) { <mask> return static_cast<char*>(p) + sizeBytes; <mask> } </s> [sdk33] Update iOS with RN 0.59 </s> remove /* * Make the real policy base classes. */ typedef IntegralSizePolicy<SizeType,!HasNoHeap::value> ActualSizePolicy; </s> add /* * Make the real policy base classes. */ typedef IntegralSizePolicy<SizeType, !HasNoHeap::value> ActualSizePolicy; </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 /* * g++ doesn't allow you to bind a non-const reference to a member * of a packed structure, presumably because it would make it too * easy to accidentally make an unaligned memory access? */ template<class T> static T& unpackHack(T* p) { return *p; } </s> add </s> remove /** * Various low-level, bit-manipulation routines. * * findFirstSet(x) [constexpr] * find first (least significant) bit set in a value of an integral type, * 1-based (like ffs()). 0 = no bits are set (x == 0) * * findLastSet(x) [constexpr] * find last (most significant) bit set in a value of an integral type, * 1-based. 0 = no bits are set (x == 0) * for x != 0, findLastSet(x) == 1 + floor(log2(x)) * * nextPowTwo(x) [constexpr] * Finds the next power of two >= x. * * isPowTwo(x) [constexpr] * return true iff x is a power of two * * popcount(x) * return the number of 1 bits in x * * Endian * convert between native, big, and little endian representation * Endian::big(x) big <-> native * Endian::little(x) little <-> native * Endian::swap(x) big <-> little * * BitIterator * Wrapper around an iterator over an integral type that iterates * over its underlying bits in MSb to LSb order * * findFirstSet(BitIterator begin, BitIterator end) * return a BitIterator pointing to the first 1 bit in [begin, end), or * end if all bits in [begin, end) are 0 * * @author Tudor Bosman ([email protected]) */ #pragma once #if !defined(__clang__) && !(defined(_MSC_VER) && (_MSC_VER < 1900)) #define FOLLY_INTRINSIC_CONSTEXPR constexpr #else // GCC and MSVC 2015+ are the only compilers with // intrinsics constexpr. #define FOLLY_INTRINSIC_CONSTEXPR const #endif #include <folly/Portability.h> #include <folly/portability/Builtins.h> #include <folly/Assume.h> #include <folly/detail/BitsDetail.h> #include <folly/detail/BitIteratorDetail.h> #include <folly/Likely.h> #if FOLLY_HAVE_BYTESWAP_H # include <byteswap.h> #endif #include <cassert> #include <cinttypes> #include <iterator> #include <limits> #include <type_traits> #include <boost/iterator/iterator_adaptor.hpp> #include <stdint.h> namespace folly { // Generate overloads for findFirstSet as wrappers around // appropriate ffs, ffsl, ffsll gcc builtins template <class T> inline FOLLY_INTRINSIC_CONSTEXPR typename std::enable_if< (std::is_integral<T>::value && std::is_unsigned<T>::value && sizeof(T) <= sizeof(unsigned int)), unsigned int>::type findFirstSet(T x) { return __builtin_ffs(x); } template <class T> inline FOLLY_INTRINSIC_CONSTEXPR typename std::enable_if< (std::is_integral<T>::value && std::is_unsigned<T>::value && sizeof(T) > sizeof(unsigned int) && sizeof(T) <= sizeof(unsigned long)), unsigned int>::type findFirstSet(T x) { return __builtin_ffsl(x); } template <class T> inline FOLLY_INTRINSIC_CONSTEXPR typename std::enable_if< (std::is_integral<T>::value && std::is_unsigned<T>::value && sizeof(T) > sizeof(unsigned long) && sizeof(T) <= sizeof(unsigned long long)), unsigned int>::type findFirstSet(T x) { return __builtin_ffsll(x); } template <class T> inline FOLLY_INTRINSIC_CONSTEXPR typename std::enable_if< (std::is_integral<T>::value && std::is_signed<T>::value), unsigned int>::type findFirstSet(T x) { // Note that conversion from a signed type to the corresponding unsigned // type is technically implementation-defined, but will likely work // on any impementation that uses two's complement. return findFirstSet(static_cast<typename std::make_unsigned<T>::type>(x)); } // findLastSet: return the 1-based index of the highest bit set // for x > 0, findLastSet(x) == 1 + floor(log2(x)) template <class T> inline FOLLY_INTRINSIC_CONSTEXPR typename std::enable_if< (std::is_integral<T>::value && std::is_unsigned<T>::value && sizeof(T) <= sizeof(unsigned int)), unsigned int>::type findLastSet(T x) { // If X is a power of two X - Y = ((X - 1) ^ Y) + 1. Doing this transformation // allows GCC to remove its own xor that it adds to implement clz using bsr return x ? ((8 * sizeof(unsigned int) - 1) ^ __builtin_clz(x)) + 1 : 0; } template <class T> inline FOLLY_INTRINSIC_CONSTEXPR typename std::enable_if< (std::is_integral<T>::value && std::is_unsigned<T>::value && sizeof(T) > sizeof(unsigned int) && sizeof(T) <= sizeof(unsigned long)), unsigned int>::type findLastSet(T x) { return x ? ((8 * sizeof(unsigned long) - 1) ^ __builtin_clzl(x)) + 1 : 0; } template <class T> inline FOLLY_INTRINSIC_CONSTEXPR typename std::enable_if< (std::is_integral<T>::value && std::is_unsigned<T>::value && sizeof(T) > sizeof(unsigned long) && sizeof(T) <= sizeof(unsigned long long)), unsigned int>::type findLastSet(T x) { return x ? ((8 * sizeof(unsigned long long) - 1) ^ __builtin_clzll(x)) + 1 : 0; } template <class T> inline FOLLY_INTRINSIC_CONSTEXPR typename std::enable_if< (std::is_integral<T>::value && std::is_signed<T>::value), unsigned int>::type findLastSet(T x) { return findLastSet(static_cast<typename std::make_unsigned<T>::type>(x)); } template <class T> inline FOLLY_INTRINSIC_CONSTEXPR typename std::enable_if< std::is_integral<T>::value && std::is_unsigned<T>::value, T>::type nextPowTwo(T v) { return v ? (T(1) << findLastSet(v - 1)) : 1; } template <class T> inline FOLLY_INTRINSIC_CONSTEXPR typename std:: enable_if<std::is_integral<T>::value && std::is_unsigned<T>::value, T>::type prevPowTwo(T v) { return v ? (T(1) << (findLastSet(v) - 1)) : 0; } template <class T> inline constexpr typename std::enable_if< std::is_integral<T>::value && std::is_unsigned<T>::value, bool>::type isPowTwo(T v) { return (v != 0) && !(v & (v - 1)); } /** * Population count */ template <class T> inline typename std::enable_if< (std::is_integral<T>::value && std::is_unsigned<T>::value && sizeof(T) <= sizeof(unsigned int)), size_t>::type popcount(T x) { return detail::popcount(x); } template <class T> inline typename std::enable_if< (std::is_integral<T>::value && std::is_unsigned<T>::value && sizeof(T) > sizeof(unsigned int) && sizeof(T) <= sizeof(unsigned long long)), size_t>::type popcount(T x) { return detail::popcountll(x); } /** * Endianness detection and manipulation primitives. */ namespace detail { template <class T> struct EndianIntBase { public: static T swap(T x); }; #ifndef _MSC_VER /** * If we have the bswap_16 macro from byteswap.h, use it; otherwise, provide our * own definition. */ #ifdef bswap_16 # define our_bswap16 bswap_16 #else template<class Int16> inline constexpr typename std::enable_if< sizeof(Int16) == 2, Int16>::type our_bswap16(Int16 x) { return ((x >> 8) & 0xff) | ((x & 0xff) << 8); } #endif #endif #define FB_GEN(t, fn) \ template<> inline t EndianIntBase<t>::swap(t x) { return fn(x); } // fn(x) expands to (x) if the second argument is empty, which is exactly // what we want for [u]int8_t. Also, gcc 4.7 on Intel doesn't have // __builtin_bswap16 for some reason, so we have to provide our own. FB_GEN( int8_t,) FB_GEN(uint8_t,) #ifdef _MSC_VER FB_GEN( int64_t, _byteswap_uint64) FB_GEN(uint64_t, _byteswap_uint64) FB_GEN( int32_t, _byteswap_ulong) FB_GEN(uint32_t, _byteswap_ulong) FB_GEN( int16_t, _byteswap_ushort) FB_GEN(uint16_t, _byteswap_ushort) #else FB_GEN( int64_t, __builtin_bswap64) FB_GEN(uint64_t, __builtin_bswap64) FB_GEN( int32_t, __builtin_bswap32) FB_GEN(uint32_t, __builtin_bswap32) FB_GEN( int16_t, our_bswap16) FB_GEN(uint16_t, our_bswap16) #endif #undef FB_GEN template <class T> struct EndianInt : public EndianIntBase<T> { public: static T big(T x) { return kIsLittleEndian ? EndianInt::swap(x) : x; } static T little(T x) { return kIsBigEndian ? EndianInt::swap(x) : x; } }; } // namespace detail // big* convert between native and big-endian representations // little* convert between native and little-endian representations // swap* convert between big-endian and little-endian representations // // ntohs, htons == big16 // ntohl, htonl == big32 #define FB_GEN1(fn, t, sz) \ static t fn##sz(t x) { return fn<t>(x); } \ #define FB_GEN2(t, sz) \ FB_GEN1(swap, t, sz) \ FB_GEN1(big, t, sz) \ FB_GEN1(little, t, sz) #define FB_GEN(sz) \ FB_GEN2(uint##sz##_t, sz) \ FB_GEN2(int##sz##_t, sz) class Endian { public: enum class Order : uint8_t { LITTLE, BIG }; static constexpr Order order = kIsLittleEndian ? Order::LITTLE : Order::BIG; template <class T> static T swap(T x) { return folly::detail::EndianInt<T>::swap(x); } template <class T> static T big(T x) { return folly::detail::EndianInt<T>::big(x); } template <class T> static T little(T x) { return folly::detail::EndianInt<T>::little(x); } #if !defined(__ANDROID__) FB_GEN(64) FB_GEN(32) FB_GEN(16) FB_GEN(8) #endif }; #undef FB_GEN #undef FB_GEN2 #undef FB_GEN1 /** * Fast bit iteration facility. */ template <class BaseIter> class BitIterator; template <class BaseIter> BitIterator<BaseIter> findFirstSet(BitIterator<BaseIter>, BitIterator<BaseIter>); /** * Wrapper around an iterator over an integer type that iterates * over its underlying bits in LSb to MSb order. * * BitIterator models the same iterator concepts as the base iterator. */ template <class BaseIter> class BitIterator : public bititerator_detail::BitIteratorBase<BaseIter>::type { public: /** * Return the number of bits in an element of the underlying iterator. */ static unsigned int bitsPerBlock() { return std::numeric_limits< typename std::make_unsigned< typename std::iterator_traits<BaseIter>::value_type >::type >::digits; } /** * Construct a BitIterator that points at a given bit offset (default 0) * in iter. */ explicit BitIterator(const BaseIter& iter, size_t bitOff=0) : bititerator_detail::BitIteratorBase<BaseIter>::type(iter), bitOffset_(bitOff) { assert(bitOffset_ < bitsPerBlock()); } size_t bitOffset() const { return bitOffset_; } void advanceToNextBlock() { bitOffset_ = 0; ++this->base_reference(); } BitIterator& operator=(const BaseIter& other) { this->~BitIterator(); new (this) BitIterator(other); return *this; } private: friend class boost::iterator_core_access; friend BitIterator findFirstSet<>(BitIterator, BitIterator); typedef bititerator_detail::BitReference< typename std::iterator_traits<BaseIter>::reference, typename std::iterator_traits<BaseIter>::value_type > BitRef; void advanceInBlock(size_t n) { bitOffset_ += n; assert(bitOffset_ < bitsPerBlock()); } BitRef dereference() const { return BitRef(*this->base_reference(), bitOffset_); } void advance(ssize_t n) { size_t bpb = bitsPerBlock(); ssize_t blocks = n / bpb; bitOffset_ += n % bpb; if (bitOffset_ >= bpb) { bitOffset_ -= bpb; ++blocks; } this->base_reference() += blocks; } void increment() { if (++bitOffset_ == bitsPerBlock()) { advanceToNextBlock(); } } void decrement() { if (bitOffset_-- == 0) { bitOffset_ = bitsPerBlock() - 1; --this->base_reference(); } } bool equal(const BitIterator& other) const { return (bitOffset_ == other.bitOffset_ && this->base_reference() == other.base_reference()); } ssize_t distance_to(const BitIterator& other) const { return (other.base_reference() - this->base_reference()) * bitsPerBlock() + other.bitOffset_ - bitOffset_; } unsigned int bitOffset_; }; /** * Helper function, so you can write * auto bi = makeBitIterator(container.begin()); */ template <class BaseIter> BitIterator<BaseIter> makeBitIterator(const BaseIter& iter) { return BitIterator<BaseIter>(iter); } /** * Find first bit set in a range of bit iterators. * 4.5x faster than the obvious std::find(begin, end, true); */ template <class BaseIter> BitIterator<BaseIter> findFirstSet(BitIterator<BaseIter> begin, BitIterator<BaseIter> end) { // shortcut to avoid ugly static_cast<> static const typename BaseIter::value_type one = 1; while (begin.base() != end.base()) { typename BaseIter::value_type v = *begin.base(); // mask out the bits that don't matter (< begin.bitOffset) v &= ~((one << begin.bitOffset()) - 1); size_t firstSet = findFirstSet(v); if (firstSet) { --firstSet; // now it's 0-based assert(firstSet >= begin.bitOffset()); begin.advanceInBlock(firstSet - begin.bitOffset()); return begin; } begin.advanceToNextBlock(); } // now begin points to the same block as end if (end.bitOffset() != 0) { // assume end is dereferenceable typename BaseIter::value_type v = *begin.base(); // mask out the bits that don't matter (< begin.bitOffset) v &= ~((one << begin.bitOffset()) - 1); // mask out the bits that don't matter (>= end.bitOffset) v &= (one << end.bitOffset()) - 1; size_t firstSet = findFirstSet(v); if (firstSet) { --firstSet; // now it's 0-based assert(firstSet >= begin.bitOffset()); begin.advanceInBlock(firstSet - begin.bitOffset()); return begin; } } return end; } template <class T, class Enable=void> struct Unaligned; /** * Representation of an unaligned value of a POD type. */ FOLLY_PACK_PUSH template <class T> struct Unaligned< T, typename std::enable_if<std::is_pod<T>::value>::type> { Unaligned() = default; // uninitialized /* implicit */ Unaligned(T v) : value(v) { } T value; } FOLLY_PACK_ATTR; FOLLY_PACK_POP /** * Read an unaligned value of type T and return it. */ template <class T> inline T loadUnaligned(const void* p) { static_assert(sizeof(Unaligned<T>) == sizeof(T), "Invalid unaligned size"); static_assert(alignof(Unaligned<T>) == 1, "Invalid alignment"); if (kHasUnalignedAccess) { return static_cast<const Unaligned<T>*>(p)->value; } else { T value; memcpy(&value, p, sizeof(T)); return value; } } /** * Write an unaligned value of type T. */ template <class T> inline void storeUnaligned(void* p, T value) { static_assert(sizeof(Unaligned<T>) == sizeof(T), "Invalid unaligned size"); static_assert(alignof(Unaligned<T>) == 1, "Invalid alignment"); if (kHasUnalignedAccess) { // Prior to C++14, the spec says that a placement new like this // is required to check that p is not nullptr, and to do nothing // if p is a nullptr. By assuming it's not a nullptr, we get a // nice loud segfault in optimized builds if p is nullptr, rather // than just silently doing nothing. folly::assume(p != nullptr); new (p) Unaligned<T>(value); } else { memcpy(p, &value, sizeof(T)); } } } // namespace folly </s> add #include <folly/lang/Bits.h> // @shim </s> remove template<class T> typename std::enable_if< FOLLY_IS_TRIVIALLY_COPYABLE(T) >::type </s> add template <class T> typename std::enable_if<folly::is_trivially_copyable<T>::value>::type
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep add keep keep keep keep keep keep
<mask> return static_cast<char*>(p) + sizeBytes; <mask> } <mask> <mask> ////////////////////////////////////////////////////////////////////// <mask> FOLLY_SV_PACK_PUSH <mask> template < <mask> class Value, <mask> std::size_t RequestedMaxInline = 1, </s> [sdk33] Update iOS with RN 0.59 </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 template <class T> T* pointerFlagSet(T* p) { return reinterpret_cast<T*>(reinterpret_cast<uintptr_t>(p) | 1); } template <class T> bool pointerFlagGet(T* p) { return reinterpret_cast<uintptr_t>(p) & 1; } template <class T> T* pointerFlagClear(T* p) { return reinterpret_cast<T*>( reinterpret_cast<uintptr_t>(p) & ~uintptr_t(1)); } inline void* shiftPointer(void* p, size_t sizeBytes) { return static_cast<char*>(p) + sizeBytes; } </s> add template <class T> T* pointerFlagSet(T* p) { return reinterpret_cast<T*>(reinterpret_cast<uintptr_t>(p) | 1); } template <class T> bool pointerFlagGet(T* p) { return reinterpret_cast<uintptr_t>(p) & 1; } template <class T> T* pointerFlagClear(T* p) { return reinterpret_cast<T*>(reinterpret_cast<uintptr_t>(p) & ~uintptr_t(1)); } inline void* shiftPointer(void* p, size_t sizeBytes) { return static_cast<char*>(p) + sizeBytes; </s> remove template<class T, std::size_t M, class A, class B, class C> </s> add template <class T, std::size_t M, class A, class B, class C> </s> remove } // small_vector_policy </s> add } // namespace small_vector_policy </s> remove for (size_t i = 0; i < n; ++i) { op(&mem[idx]); ++idx; </s> add if (begin + pos < end) { this->moveToUninitialized(begin + pos, end, out + pos + 1); </s> remove template<class T, std::size_t MaxInline, class A, class B, class C> void swap(small_vector<T,MaxInline,A,B,C>& a, small_vector<T,MaxInline,A,B,C>& b) { </s> add template <class T, std::size_t MaxInline, class A, class B, class C> void swap( small_vector<T, MaxInline, A, B, C>& a, small_vector<T, MaxInline, A, B, C>& b) {
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
<mask> } <mask> } <mask> <mask> ////////////////////////////////////////////////////////////////////// <mask> FOLLY_PACK_PUSH <mask> template<class Value, <mask> std::size_t RequestedMaxInline = 1, <mask> class PolicyA = void, <mask> class PolicyB = void, <mask> class PolicyC = void> <mask> class small_vector <mask> : public detail::small_vector_base< <mask> Value,RequestedMaxInline,PolicyA,PolicyB,PolicyC <mask> >::type <mask> { <mask> typedef typename detail::small_vector_base< <mask> Value,RequestedMaxInline,PolicyA,PolicyB,PolicyC <mask> >::type BaseType; <mask> typedef typename BaseType::InternalSizeType InternalSizeType; <mask> <mask> /* <mask> * Figure out the max number of elements we should inline. (If <mask> * the user asks for less inlined elements than we can fit unioned </s> [sdk33] Update iOS with RN 0.59 </s> remove namespace mpl = boost::mpl; template<class Value, std::size_t RequestedMaxInline, class InPolicyA, class InPolicyB, class InPolicyC> struct small_vector_base { typedef mpl::vector<InPolicyA,InPolicyB,InPolicyC> PolicyList; /* * Determine the size type */ typedef typename mpl::filter_view< </s> add typedef typename mpl::filter_view< </s> add } // namespace detail </s> remove } // Specialization for trivially copyable types. The call to // std::move_backward here will just turn into a memmove. (TODO: // change to std::is_trivially_copyable when that works.) template<class T> typename std::enable_if< FOLLY_IS_TRIVIALLY_COPYABLE(T) >::type moveObjectsRight(T* first, T* lastConstructed, T* realLast) { std::move_backward(first, lastConstructed, realLast); } /* * Populate a region of memory using `op' to construct elements. If * anything throws, undo what we did. */ template<class T, class Function> void populateMemForward(T* mem, std::size_t n, Function const& op) { std::size_t idx = 0; </s> add // move old elements to the right of the new one </s> remove /* * Determine whether we should allow spilling to the heap or not. */ typedef typename mpl::count< PolicyList,small_vector_policy::NoHeap >::type HasNoHeap; </s> add /* * Determine whether we should allow spilling to the heap or not. */ typedef typename mpl::count<PolicyList, small_vector_policy::NoHeap>::type HasNoHeap; </s> remove constexpr ThreadLocal() : constructor_([]() { return new T(); }) {} </s> add constexpr ThreadLocal() : constructor_([]() { return new T(); }) {} </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> {
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep keep replace replace replace replace replace replace replace replace replace keep keep keep keep keep
<mask> static constexpr std::size_t MaxInline{ <mask> constexpr_max(sizeof(Value*) / sizeof(Value), RequestedMaxInline)}; <mask> <mask> public: <mask> typedef std::size_t size_type; <mask> typedef Value value_type; <mask> typedef value_type& reference; <mask> typedef value_type const& const_reference; <mask> typedef value_type* iterator; <mask> typedef value_type const* const_iterator; <mask> typedef std::ptrdiff_t difference_type; <mask> <mask> typedef std::reverse_iterator<iterator> reverse_iterator; <mask> typedef std::reverse_iterator<const_iterator> const_reverse_iterator; <mask> <mask> explicit small_vector() = default; <mask> <mask> small_vector(small_vector const& o) { </s> [sdk33] Update iOS with RN 0.59 </s> remove typedef std::reverse_iterator<iterator #ifdef NO_ITERATOR_TRAITS , value_type #endif > reverse_iterator; typedef std::reverse_iterator<const_iterator #ifdef NO_ITERATOR_TRAITS , const value_type #endif > const_reverse_iterator; </s> add typedef std::reverse_iterator<iterator> reverse_iterator; typedef std::reverse_iterator<const_iterator> const_reverse_iterator; </s> remove explicit small_vector() = default; </s> add small_vector() = default; // Allocator is unused here. It is taken in for compatibility with std::vector // interface, but it will be ignored. small_vector(const std::allocator<Value>&) {} </s> remove typedef T value_type; </s> add typedef T value_type; </s> remove template<typename ValT, typename NodeT> class detail::csl_iterator : public boost::iterator_facade<csl_iterator<ValT, NodeT>, ValT, boost::forward_traversal_tag> { </s> add template <typename ValT, typename NodeT> class detail::csl_iterator : public boost::iterator_facade< csl_iterator<ValT, NodeT>, ValT, boost::forward_traversal_tag> { </s> remove Skipper(const std::shared_ptr<SkipListType>& skipList) : accessor_(skipList) { </s> add Skipper(const std::shared_ptr<SkipListType>& skipList) : accessor_(skipList) { </s> remove : slHolder_(std::move(skip_list)) { </s> add : slHolder_(std::move(skip_list)) {
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> typedef std::reverse_iterator<iterator> reverse_iterator; <mask> typedef std::reverse_iterator<const_iterator> const_reverse_iterator; <mask> <mask> explicit small_vector() = default; <mask> <mask> small_vector(small_vector const& o) { <mask> auto n = o.size(); <mask> makeSize(n); <mask> try { </s> [sdk33] Update iOS with RN 0.59 </s> remove typedef std::size_t size_type; typedef Value value_type; typedef value_type& reference; typedef value_type const& const_reference; typedef value_type* iterator; typedef value_type const* const_iterator; typedef std::ptrdiff_t difference_type; typedef std::reverse_iterator<iterator> reverse_iterator; </s> add typedef std::size_t size_type; typedef Value value_type; typedef value_type& reference; typedef value_type const& const_reference; typedef value_type* iterator; typedef value_type* pointer; typedef value_type const* const_iterator; typedef std::ptrdiff_t difference_type; typedef std::reverse_iterator<iterator> reverse_iterator; </s> remove typedef std::reverse_iterator<iterator #ifdef NO_ITERATOR_TRAITS , value_type #endif > reverse_iterator; typedef std::reverse_iterator<const_iterator #ifdef NO_ITERATOR_TRAITS , const value_type #endif > const_reverse_iterator; </s> add typedef std::reverse_iterator<iterator> reverse_iterator; typedef std::reverse_iterator<const_iterator> const_reverse_iterator; </s> remove void doConstruct(size_type n, value_type const& val) { </s> add template <typename InitFunc> void doConstruct(size_type n, InitFunc&& func) { </s> remove detail::populateMemForward(data(), n, [&] (void* p) { new (p) value_type(val); } ); </s> add detail::populateMemForward(data(), n, std::forward<InitFunc>(func)); </s> remove private: </s> add private: </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/small_vector.h
keep replace replace keep keep keep replace replace replace keep keep
<mask> <mask> small_vector(small_vector&& o) <mask> noexcept(std::is_nothrow_move_constructible<Value>::value) { <mask> if (o.isExtern()) { <mask> swap(o); <mask> } else { <mask> std::uninitialized_copy(std::make_move_iterator(o.begin()), <mask> std::make_move_iterator(o.end()), <mask> begin()); <mask> this->setSize(o.size()); <mask> } </s> [sdk33] Update iOS with RN 0.59 </s> remove if (this == &o) return *this; clear(); swap(o); </s> add if (FOLLY_LIKELY(this != &o)) { clear(); swap(o); } </s> remove assign(o.begin(), o.end()); </s> add if (FOLLY_LIKELY(this != &o)) { assign(o.begin(), o.end()); } </s> remove if (c == '\r') output += 'r'; else if (c == '\n') output += 'n'; else if (c == '\t') output += 't'; else if (c == '\a') output += 'a'; else if (c == '\b') output += 'b'; else if (c == '\0') output += '0'; else if (c == '\\') output += '\\'; else { </s> add if (c == '\r') { output += 'r'; } else if (c == '\n') { output += 'n'; } else if (c == '\t') { output += 't'; } else if (c == '\a') { output += 'a'; } else if (c == '\b') { output += 'b'; } else if (c == '\0') { output += '0'; } else if (c == '\\') { output += '\\'; } else { </s> remove return C(dynamicconverter_detail::conversionIterator<C> (d.items().begin()), dynamicconverter_detail::conversionIterator<C> (d.items().end())); </s> add return C( dynamicconverter_detail::conversionIterator<C>(d.items().begin()), dynamicconverter_detail::conversionIterator<C>(d.items().end())); </s> add } else { return static_cast<value_type*>(detail::shiftPointer( detail::pointerFlagClear(pdata_.heap_), kHeapifyCapacitySize));
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep replace replace keep keep replace replace
<mask> <mask> explicit small_vector(size_type n, value_type const& t = value_type()) { <mask> doConstruct(n, t); <mask> } <mask> <mask> template<class Arg> <mask> explicit small_vector(Arg arg1, Arg arg2) { </s> [sdk33] Update iOS with RN 0.59 </s> remove template<class Arg> </s> add template <class Arg> </s> remove template<class Arg> </s> add template <class Arg> </s> remove doConstruct(n, val); </s> add doConstruct(n, [&](void* p) { new (p) value_type(val); }); } /* * Compute the size after growth. */ size_type computeNewSize() const { return std::min((3 * capacity()) / 2 + 1, max_size()); </s> remove void doConstruct(size_type n, value_type const& val) { </s> add template <typename InitFunc> void doConstruct(size_type n, InitFunc&& func) { </s> remove detail::populateMemForward(data(), n, [&] (void* p) { new (p) value_type(val); } ); </s> add detail::populateMemForward(data(), n, std::forward<InitFunc>(func));
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> } <mask> <mask> small_vector& operator=(small_vector const& o) { <mask> assign(o.begin(), o.end()); <mask> return *this; <mask> } <mask> <mask> small_vector& operator=(small_vector&& o) { <mask> // TODO: optimization: </s> [sdk33] Update iOS with RN 0.59 </s> remove if (this == &o) return *this; clear(); swap(o); </s> add if (FOLLY_LIKELY(this != &o)) { clear(); swap(o); } </s> remove small_vector(small_vector&& o) noexcept(std::is_nothrow_move_constructible<Value>::value) { </s> add small_vector(small_vector&& o) noexcept( std::is_nothrow_move_constructible<Value>::value) { </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 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 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 // TODO: we'd like to make use of makeSize (it can be optimized better, // because it manipulates the internals) // unfortunately the current implementation only supports moving from // a supplied rvalue, and doing an extra move just to reuse it is a perf // net loss if (size() == capacity()) {// && isInside(&t)) { value_type tmp(t); emplaceBack(std::move(tmp)); } else { emplaceBack(t); } </s> add emplace_back(t);
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep keep replace replace replace keep keep keep keep keep
<mask> <mask> small_vector& operator=(small_vector&& o) { <mask> // TODO: optimization: <mask> // if both are internal, use move assignment where possible <mask> if (this == &o) return *this; <mask> clear(); <mask> swap(o); <mask> return *this; <mask> } <mask> <mask> bool operator==(small_vector const& o) const { <mask> return size() == o.size() && std::equal(begin(), end(), o.begin()); </s> [sdk33] Update iOS with RN 0.59 </s> remove assign(o.begin(), o.end()); </s> add if (FOLLY_LIKELY(this != &o)) { assign(o.begin(), o.end()); } </s> remove small_vector(small_vector&& o) noexcept(std::is_nothrow_move_constructible<Value>::value) { </s> add small_vector(small_vector&& o) noexcept( std::is_nothrow_move_constructible<Value>::value) { </s> remove // This implementation is similar to std::exception_ptr's implementation // where two exception_wrappers are equal when the address in the underlying // reference field both point to the same exception object. The reference // field remains the same when the exception_wrapper is copied or when // the exception_wrapper is "rethrown". bool operator==(const exception_wrapper& a) const { if (item_) { return a.item_ && item_.get() == a.item_.get(); } else { return eptr_ == a.eptr_; } } </s> add template <class Fn, class A> FOLLY_ALWAYS_INLINE FOLLY_ATTR_VISIBILITY_HIDDEN auto fold(Fn&&, A&& a) { return static_cast<A&&>(a); } </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 bool empty() const { return size() == 0; } </s> add bool empty() const { return size() == 0; } </s> remove return begin() <= end() && empty() == (size() == 0) && empty() == (begin() == end()) && size() <= max_size() && capacity() <= max_size() && size() <= capacity() && begin()[size()] == '\0'; </s> add return begin() <= end() && empty() == (size() == 0) && empty() == (begin() == end()) && size() <= max_size() && capacity() <= max_size() && size() <= capacity() && begin()[size()] == '\0';
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep keep replace replace keep keep keep keep keep
<mask> return !BaseType::kShouldUseHeap ? static_cast<size_type>(MaxInline) <mask> : BaseType::policyMaxSize(); <mask> } <mask> <mask> size_type size() const { return this->doSize(); } <mask> bool empty() const { return !size(); } <mask> <mask> iterator begin() { return data(); } <mask> iterator end() { return data() + size(); } <mask> const_iterator begin() const { return data(); } <mask> const_iterator end() const { return data() + size(); } </s> [sdk33] Update iOS with RN 0.59 </s> remove iterator begin() { return data(); } iterator end() { return data() + size(); } const_iterator begin() const { return data(); } const_iterator end() const { return data() + size(); } const_iterator cbegin() const { return begin(); } const_iterator cend() const { return end(); } </s> add iterator begin() { return data(); } iterator end() { return data() + size(); } const_iterator begin() const { return data(); } const_iterator end() const { return data() + size(); } const_iterator cbegin() const { return begin(); } const_iterator cend() const { return end(); } </s> remove reverse_iterator rbegin() { return reverse_iterator(end()); } reverse_iterator rend() { return reverse_iterator(begin()); } </s> add reverse_iterator rbegin() { return reverse_iterator(end()); } reverse_iterator rend() { return reverse_iterator(begin()); } </s> remove iterator end() const { return iterator(nullptr); } const_iterator cbegin() const { return begin(); } const_iterator cend() const { return end(); } </s> add iterator end() const { return iterator(nullptr); } const_iterator cbegin() const { return begin(); } const_iterator cend() const { return end(); } </s> remove size_type count(const key_type &data) const { return contains(data); } </s> add const_iterator find(const key_type& value) const { return iterator(sl_->find(value)); } size_type count(const key_type& data) const { return contains(data); } </s> remove bool empty() const { return size() == 0; } </s> add bool empty() const { return size() == 0; } </s> remove iterator end() { return iterator(this, capacity_); } const_iterator end() const { return const_iterator(this, capacity_); } </s> add iterator end() { return iterator(this, capacity_); } const_iterator end() const { return const_iterator(this, capacity_); }
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep replace replace replace replace replace replace keep replace replace keep
<mask> size_type size() const { return this->doSize(); } <mask> bool empty() const { return !size(); } <mask> <mask> iterator begin() { return data(); } <mask> iterator end() { return data() + size(); } <mask> const_iterator begin() const { return data(); } <mask> const_iterator end() const { return data() + size(); } <mask> const_iterator cbegin() const { return begin(); } <mask> const_iterator cend() const { return end(); } <mask> <mask> reverse_iterator rbegin() { return reverse_iterator(end()); } <mask> reverse_iterator rend() { return reverse_iterator(begin()); } <mask> </s> [sdk33] Update iOS with RN 0.59 </s> remove size_type size() const { return this->doSize(); } bool empty() const { return !size(); } </s> add size_type size() const { return this->doSize(); } bool empty() const { return !size(); } </s> remove const_iterator cend() const { return end(); } </s> add const_iterator cend() const { return end(); } </s> remove iterator end() const { return iterator(nullptr); } const_iterator cbegin() const { return begin(); } const_iterator cend() const { return end(); } </s> add iterator end() const { return iterator(nullptr); } const_iterator cbegin() const { return begin(); } const_iterator cend() const { return end(); } </s> remove template<typename U, typename=typename std::enable_if<std::is_convertible<U, T>::value>::type> </s> add template < typename U, typename = typename std::enable_if<std::is_convertible<U, T>::value>::type> </s> remove size_type count(const key_type &data) const { return contains(data); } </s> add const_iterator find(const key_type& value) const { return iterator(sl_->find(value)); } size_type count(const key_type& data) const { return contains(data); }
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep keep replace replace keep keep keep keep keep
<mask> const_reverse_iterator rend() const { <mask> return const_reverse_iterator(begin()); <mask> } <mask> <mask> const_reverse_iterator crbegin() const { return rbegin(); } <mask> const_reverse_iterator crend() const { return rend(); } <mask> <mask> /* <mask> * Usually one of the simplest functions in a Container-like class <mask> * but a bit more complex here. We have to handle all combinations <mask> * of in-place vs. heap between this and o. </s> [sdk33] Update iOS with RN 0.59 </s> remove const_reverse_iterator crend() const { return rend(); } </s> add const_reverse_iterator crend() const { return rend(); } </s> remove const_reverse_iterator crbegin() const { return rbegin(); } </s> add const_reverse_iterator crbegin() const { return rbegin(); } </s> remove const value_type& front() const { return *begin(); } </s> add const value_type& front() const { return *begin(); } </s> remove reverse_iterator rbegin() { return reverse_iterator(end()); } reverse_iterator rend() { return reverse_iterator(begin()); } </s> add reverse_iterator rbegin() { return reverse_iterator(end()); } reverse_iterator rend() { return reverse_iterator(begin()); } </s> remove iterator begin() { return data(); } iterator end() { return data() + size(); } const_iterator begin() const { return data(); } const_iterator end() const { return data() + size(); } const_iterator cbegin() const { return begin(); } const_iterator cend() const { return end(); } </s> add iterator begin() { return data(); } iterator end() { return data() + size(); } const_iterator begin() const { return data(); } const_iterator end() const { return data() + size(); } const_iterator cbegin() const { return begin(); } const_iterator cend() const { return end(); } </s> remove InternalSizeType* getCapacity() { </s> add InternalSizeType getCapacity() const {
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> auto thisCapacity = this->capacity(); <mask> auto oCapacity = o.capacity(); <mask> <mask> std::swap(unpackHack(&u.pdata_.heap_), unpackHack(&o.u.pdata_.heap_)); <mask> <mask> this->setCapacity(oCapacity); <mask> o.setCapacity(thisCapacity); <mask> <mask> return; </s> [sdk33] Update iOS with RN 0.59 </s> remove RWSpinLock::ReadHolder rh(&vault_.stateMutex_); if (vault_.state_ == SingletonVault::SingletonVaultState::Quiescing) { if (vault_.type_ != SingletonVault::Type::Relaxed) { LOG(FATAL) << "Requesting singleton after vault was destroyed."; } </s> add auto state = vault_.state_.rlock(); if (vault_.type_ != SingletonVault::Type::Relaxed && !state->registrationComplete) { detail::singletonWarnCreateBeforeRegistrationCompleteAndAbort(type()); } if (state->state == detail::SingletonVaultState::Type::Quiescing) { </s> remove SingletonHolderState::NotRegistered) { auto ptr = SingletonVault::stackTraceGetter().load(); LOG(FATAL) << "Creating instance for unregistered singleton: " << type().name() << "\n" << "Stacktrace:" << "\n" << (ptr ? (*ptr)() : "(not available)"); </s> add SingletonHolderState::NotRegistered) { detail::singletonWarnCreateUnregisteredAndAbort(type()); </s> remove auto needBytes = size * sizeof(value_type); </s> add assert(this->kShouldUseHeap); // This branch isn't needed for correctness, but allows the optimizer to // skip generating code for the rest of this function in NoHeap // small_vectors. if (!this->kShouldUseHeap) { return; } newSize = std::max(newSize, computeNewSize()); auto needBytes = newSize * sizeof(value_type); </s> remove auto oldExternHeap = oldExtern.u.pdata_.heap_; </s> add auto oldExternHeap = oldExtern.u.pdata_.heap_; </s> remove if (size <= this->capacity()) { </s> add if (newSize <= capacity()) { assert(!insert); </s> remove auto const r2 = clock_gettime(CLOCK_REALTIME, &end); </s> add auto end = std::chrono::high_resolution_clock::now();
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep keep replace keep keep keep keep keep
<mask> auto& oldExtern = o.isExtern() ? o : *this; <mask> auto& oldIntern = o.isExtern() ? *this : o; <mask> <mask> auto oldExternCapacity = oldExtern.capacity(); <mask> auto oldExternHeap = oldExtern.u.pdata_.heap_; <mask> <mask> auto buff = oldExtern.u.buffer(); <mask> size_type i = 0; <mask> try { <mask> for (; i < oldIntern.size(); ++i) { </s> [sdk33] Update iOS with RN 0.59 </s> remove auto unhex = [](char c) -> int { return c >= '0' && c <= '9' ? c - '0' : c >= 'A' && c <= 'F' ? c - 'A' + 10 : c >= 'a' && c <= 'f' ? c - 'a' + 10 : -1; }; </s> add </s> remove for (size_t i = 0; i < n; ++i) { op(&mem[idx]); ++idx; </s> add if (begin + pos < end) { this->moveToUninitialized(begin + pos, end, out + pos + 1); </s> remove for (std::size_t i = 0; i < idx; ++i) { mem[i].~T(); </s> add for (SizeType i = 0; i <= pos; ++i) { out[i].~T(); </s> remove sizeLimitTable_[i] = sizeLimit > kMaxSizeLimit ? kMaxSizeLimit : static_cast<size_t>(sizeLimit); </s> add sizeLimitTable_[i] = sizeLimit > kMaxSizeLimit ? kMaxSizeLimit : static_cast<size_t>(sizeLimit); </s> remove for (int i = 0; i < node->height_; ++i) { </s> add for (uint8_t i = 0; i < node->height_; ++i) { </s> remove RWSpinLock::ReadHolder rh(&mutex_); </s> add auto singletons = singletons_.rlock();
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep keep replace replace replace keep keep keep keep keep
<mask> erase(begin() + sz, end()); <mask> return; <mask> } <mask> makeSize(sz); <mask> detail::populateMemForward(begin() + size(), sz - size(), <mask> [&] (void* p) { new (p) value_type(); } <mask> ); <mask> this->setSize(sz); <mask> } <mask> <mask> void resize(size_type sz, value_type const& v) { <mask> if (sz < size()) { </s> [sdk33] Update iOS with RN 0.59 </s> remove detail::populateMemForward(begin() + size(), sz - size(), [&] (void* p) { new (p) value_type(v); } ); </s> add detail::populateMemForward( begin() + size(), sz - size(), [&](void* p) { new (p) value_type(v); }); </s> remove detail::populateMemForward(data(), n, [&] (void* p) { new (p) value_type(val); } ); </s> add detail::populateMemForward(data(), n, std::forward<InitFunc>(func)); </s> remove void doConstruct(size_type n, value_type const& val) { </s> add template <typename InitFunc> void doConstruct(size_type n, InitFunc&& func) { </s> remove detail::populateMemForward(data(), distance, [&] (void* p) { new (p) value_type(*first++); } ); </s> add detail::populateMemForward( data(), distance, [&](void* p) { new (p) value_type(*first++); }); </s> remove detail::moveObjectsRight(data() + offset, data() + size(), data() + size() + n); </s> add detail::moveObjectsRight( data() + offset, data() + size(), data() + size() + n); </s> remove makeSize(size() + 1, &t, offset); </s> add makeSize( size() + 1, [&t](void* ptr) { new (ptr) value_type(std::move(t)); }, offset);
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep keep replace replace replace keep keep keep keep keep
<mask> erase(begin() + sz, end()); <mask> return; <mask> } <mask> makeSize(sz); <mask> detail::populateMemForward(begin() + size(), sz - size(), <mask> [&] (void* p) { new (p) value_type(v); } <mask> ); <mask> this->setSize(sz); <mask> } <mask> <mask> value_type* data() noexcept { <mask> return this->isExtern() ? u.heap() : u.buffer(); </s> [sdk33] Update iOS with RN 0.59 </s> remove detail::populateMemForward(begin() + size(), sz - size(), [&] (void* p) { new (p) value_type(); } ); </s> add detail::populateMemForward( begin() + size(), sz - size(), [&](void* p) { new (p) value_type(); }); </s> remove template<class ...Args> </s> add template <class... Args> </s> remove detail::populateMemForward(data(), distance, [&] (void* p) { new (p) value_type(*first++); } ); </s> add detail::populateMemForward( data(), distance, [&](void* p) { new (p) value_type(*first++); }); </s> remove detail::moveObjectsRight(data() + offset, data() + size(), data() + size() + n); </s> add detail::moveObjectsRight( data() + offset, data() + size(), data() + size() + n); </s> remove detail::populateMemForward(data(), n, [&] (void* p) { new (p) value_type(val); } ); </s> add detail::populateMemForward(data(), n, std::forward<InitFunc>(func)); </s> remove makeSize(size() + 1); detail::moveObjectsRight(data() + offset, data() + size(), data() + size() + 1); </s> add detail::moveObjectsRight( data() + offset, data() + size(), data() + size() + 1);
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep keep replace keep keep keep keep keep
<mask> value_type const* data() const noexcept { <mask> return this->isExtern() ? u.heap() : u.buffer(); <mask> } <mask> <mask> template<class ...Args> <mask> iterator emplace(const_iterator p, Args&&... args) { <mask> if (p == cend()) { <mask> emplace_back(std::forward<Args>(args)...); <mask> return end() - 1; <mask> } </s> [sdk33] Update iOS with RN 0.59 </s> remove detail::populateMemForward(begin() + size(), sz - size(), [&] (void* p) { new (p) value_type(v); } ); </s> add detail::populateMemForward( begin() + size(), sz - size(), [&](void* p) { new (p) value_type(v); }); </s> remove size_type size() const { return this->doSize(); } bool empty() const { return !size(); } </s> add size_type size() const { return this->doSize(); } bool empty() const { return !size(); } </s> remove iterator begin() { return data(); } iterator end() { return data() + size(); } const_iterator begin() const { return data(); } const_iterator end() const { return data() + size(); } const_iterator cbegin() const { return begin(); } const_iterator cend() const { return end(); } </s> add iterator begin() { return data(); } iterator end() { return data() + size(); } const_iterator begin() const { return data(); } const_iterator end() const { return data() + size(); } const_iterator cbegin() const { return begin(); } const_iterator cend() const { return end(); } </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_; } </s> remove auto& fn = *static_cast<const Function<ReturnType(Args...) const>*>(this); </s> add auto& fn = *static_cast<const Function<ConstSignature>*>(this); return fn.call_(fn.data_, static_cast<Args&&>(args)...); } class SharedProxy { std::shared_ptr<Function<ConstSignature>> sp_; public: explicit SharedProxy(Function<ConstSignature>&& func) : sp_(std::make_shared<Function<ConstSignature>>(std::move(func))) {} ReturnType operator()(Args&&... args) const { return (*sp_)(static_cast<Args&&>(args)...); } }; }; #if FOLLY_HAVE_NOEXCEPT_FUNCTION_TYPE template <typename ReturnType, typename... Args> struct FunctionTraits<ReturnType(Args...) noexcept> { using Call = ReturnType (*)(Data&, Args&&...) noexcept; using IsConst = std::false_type; using ConstSignature = ReturnType(Args...) const noexcept; using NonConstSignature = ReturnType(Args...) noexcept; using OtherSignature = ConstSignature; template <typename F> using ResultOf = SafeResultOf<CallableResult<_t<std::decay<F>>&, Args...>, ReturnType>; template <typename Fun> static ReturnType callSmall(Data& p, Args&&... args) noexcept { return static_cast<ReturnType>((*static_cast<Fun*>( static_cast<void*>(&p.tiny)))(static_cast<Args&&>(args)...)); } template <typename Fun> static ReturnType callBig(Data& p, Args&&... args) noexcept { return static_cast<ReturnType>( (*static_cast<Fun*>(p.big))(static_cast<Args&&>(args)...)); } static ReturnType uninitCall(Data&, Args&&...) noexcept { terminate_with<std::bad_function_call>(); } ReturnType operator()(Args... args) noexcept { auto& fn = *static_cast<Function<NonConstSignature>*>(this); </s> add } else { return static_cast<value_type*>(detail::shiftPointer( detail::pointerFlagClear(pdata_.heap_), kHeapifyCapacitySize));
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> size_type capacity() const { <mask> if (this->isExtern()) { <mask> if (u.hasCapacity()) { <mask> return *u.getCapacity(); <mask> } <mask> return malloc_usable_size(u.pdata_.heap_) / sizeof(value_type); <mask> } <mask> return MaxInline; <mask> } </s> [sdk33] Update iOS with RN 0.59 </s> remove size_type capacity() const { return store_.capacity(); } </s> add size_type capacity() const { return store_.capacity(); } </s> remove enforce(res_arg <= max_size(), std::__throw_length_error, ""); </s> add enforce<std::length_error>(res_arg <= max_size(), ""); </s> remove size_type length() const { return size(); } </s> add size_type length() const { return size(); } </s> remove size_type size() const { return store_.size(); } </s> add size_type size() const { return store_.size(); } </s> remove size_type size() const { return this->doSize(); } bool empty() const { return !size(); } </s> add size_type size() const { return this->doSize(); } bool empty() const { return !size(); } </s> add } catch (...) { free(newh); throw;
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep keep replace keep keep keep keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep
<mask> small_vector tmp(begin(), end()); <mask> tmp.swap(*this); <mask> } <mask> <mask> template<class ...Args> <mask> void emplace_back(Args&&... args) { <mask> // call helper function for static dispatch of special cases <mask> emplaceBack(std::forward<Args>(args)...); <mask> } <mask> <mask> template<class ...Args> <mask> void emplace_back(Args&&... args) { <mask> // call helper function for static dispatch of special cases <mask> emplaceBack(std::forward<Args>(args)...); <mask> } <mask> <mask> void emplace_back(const value_type& t) { <mask> push_back(t); <mask> } <mask> void emplace_back(value_type& t) { <mask> push_back(t); <mask> } <mask> <mask> void emplace_back(value_type&& t) { <mask> push_back(std::move(t)); <mask> } <mask> <mask> void push_back(value_type&& t) { <mask> if (capacity() == size()) { </s> [sdk33] Update iOS with RN 0.59 </s> remove new (end()) value_type(std::move(t)); </s> add new (end()) value_type(std::forward<Args>(args)...); </s> add void push_back(value_type&& t) { return emplace_back(std::move(t)); } </s> remove private: /* * This is doing the same like emplace_back, but we need this helper * to catch the special case - see the next overload function.. */ template<class ...Args> void emplaceBack(Args&&... args) { makeSize(size() + 1); new (end()) value_type(std::forward<Args>(args)...); this->setSize(size() + 1); } </s> add private: </s> remove TeardownFunc t) { </s> add TeardownFunc t) { </s> remove makeSize(std::max(size_type(2), 3 * size() / 2), &t, size()); </s> add // Any of args may be references into the vector. // When we are reallocating, we have to be careful to construct the new // element before modifying the data in the old buffer. makeSize( size() + 1, [&](void* p) { new (p) value_type(std::forward<Args>(args)...); }, size());
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep replace keep replace keep
<mask> if (capacity() == size()) { <mask> makeSize(std::max(size_type(2), 3 * size() / 2), &t, size()); <mask> } else { <mask> new (end()) value_type(std::move(t)); <mask> } </s> [sdk33] Update iOS with RN 0.59 </s> remove // call helper function for static dispatch of special cases emplaceBack(std::forward<Args>(args)...); } void emplace_back(const value_type& t) { push_back(t); } void emplace_back(value_type& t) { push_back(t); } void emplace_back(value_type&& t) { push_back(std::move(t)); } void push_back(value_type&& t) { </s> add </s> remove makeSize(size() + 1, &t, offset); </s> add makeSize( size() + 1, [&t](void* ptr) { new (ptr) value_type(std::move(t)); }, offset); </s> remove makeSize(size() + 1); detail::moveObjectsRight(data() + offset, data() + size(), data() + size() + 1); </s> add detail::moveObjectsRight( data() + offset, data() + size(), data() + size() + 1); </s> remove if (c == '\r') output += 'r'; else if (c == '\n') output += 'n'; else if (c == '\t') output += 't'; else if (c == '\a') output += 'a'; else if (c == '\b') output += 'b'; else if (c == '\0') output += '0'; else if (c == '\\') output += '\\'; else { </s> add if (c == '\r') { output += 'r'; } else if (c == '\n') { output += 'n'; } else if (c == '\t') { output += 't'; } else if (c == '\a') { output += 'a'; } else if (c == '\b') { output += 'b'; } else if (c == '\0') { output += '0'; } else if (c == '\\') { output += '\\'; } else { </s> remove detail::populateMemForward(begin() + size(), sz - size(), [&] (void* p) { new (p) value_type(); } ); </s> add detail::populateMemForward( begin() + size(), sz - size(), [&](void* p) { new (p) value_type(); });
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep add keep keep keep keep keep
<mask> this->setSize(size() + 1); <mask> } <mask> <mask> void push_back(value_type const& t) { <mask> emplace_back(t); <mask> } <mask> <mask> void pop_back() { </s> [sdk33] Update iOS with RN 0.59 </s> remove new (end()) value_type(std::move(t)); </s> add new (end()) value_type(std::forward<Args>(args)...); </s> remove // TODO: we'd like to make use of makeSize (it can be optimized better, // because it manipulates the internals) // unfortunately the current implementation only supports moving from // a supplied rvalue, and doing an extra move just to reuse it is a perf // net loss if (size() == capacity()) {// && isInside(&t)) { value_type tmp(t); emplaceBack(std::move(tmp)); } else { emplaceBack(t); } </s> add emplace_back(t); </s> remove makeSize(std::max(size_type(2), 3 * size() / 2), &t, size()); </s> add // Any of args may be references into the vector. // When we are reallocating, we have to be careful to construct the new // element before modifying the data in the old buffer. makeSize( size() + 1, [&](void* p) { new (p) value_type(std::forward<Args>(args)...); }, size()); </s> remove // call helper function for static dispatch of special cases emplaceBack(std::forward<Args>(args)...); } void emplace_back(const value_type& t) { push_back(t); } void emplace_back(value_type& t) { push_back(t); } void emplace_back(value_type&& t) { push_back(std::move(t)); } void push_back(value_type&& t) { </s> add </s> remove private: /* * This is doing the same like emplace_back, but we need this helper * to catch the special case - see the next overload function.. */ template<class ...Args> void emplaceBack(Args&&... args) { makeSize(size() + 1); new (end()) value_type(std::forward<Args>(args)...); this->setSize(size() + 1); } </s> add private: </s> remove makeSize(size() + 1); detail::moveObjectsRight(data() + offset, data() + size(), data() + size() + 1); </s> add detail::moveObjectsRight( data() + offset, data() + size(), data() + size() + 1);
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
<mask> this->setSize(size() + 1); <mask> } <mask> <mask> void push_back(value_type const& t) { <mask> // TODO: we'd like to make use of makeSize (it can be optimized better, <mask> // because it manipulates the internals) <mask> // unfortunately the current implementation only supports moving from <mask> // a supplied rvalue, and doing an extra move just to reuse it is a perf <mask> // net loss <mask> if (size() == capacity()) {// && isInside(&t)) { <mask> value_type tmp(t); <mask> emplaceBack(std::move(tmp)); <mask> } else { <mask> emplaceBack(t); <mask> } <mask> } <mask> <mask> void pop_back() { <mask> erase(end() - 1); <mask> } </s> [sdk33] Update iOS with RN 0.59 </s> add void push_back(value_type&& t) { return emplace_back(std::move(t)); } </s> remove new (end()) value_type(std::move(t)); </s> add new (end()) value_type(std::forward<Args>(args)...); </s> remove private: /* * This is doing the same like emplace_back, but we need this helper * to catch the special case - see the next overload function.. */ template<class ...Args> void emplaceBack(Args&&... args) { makeSize(size() + 1); new (end()) value_type(std::forward<Args>(args)...); this->setSize(size() + 1); } </s> add private: </s> remove makeSize(std::max(size_type(2), 3 * size() / 2), &t, size()); </s> add // Any of args may be references into the vector. // When we are reallocating, we have to be careful to construct the new // element before modifying the data in the old buffer. makeSize( size() + 1, [&](void* p) { new (p) value_type(std::forward<Args>(args)...); }, size()); </s> remove doConstruct(n, val); </s> add doConstruct(n, [&](void* p) { new (p) value_type(val); }); } /* * Compute the size after growth. */ size_type computeNewSize() const { return std::min((3 * capacity()) / 2 + 1, max_size()); </s> remove bool operator!=(const exception_wrapper& a) const { return !(*this == a); } </s> add template <class Fn, class A, class B, class... Bs> FOLLY_ALWAYS_INLINE FOLLY_ATTR_VISIBILITY_HIDDEN auto fold(Fn&& fn, A&& a, B&& b, Bs&&... bs) { return fold( // This looks like a use of fn after a move of fn, but in reality, this is // just a cast and not a move. That's because regardless of which fold // overload is selected, fn gets bound to a &&. Had fold taken fn by value // there would indeed be a problem here. static_cast<Fn&&>(fn), static_cast<Fn&&>(fn)(static_cast<A&&>(a), static_cast<B&&>(b)), static_cast<Bs&&>(bs)...); }
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep replace keep keep replace replace replace replace keep keep keep keep
<mask> auto offset = p - begin(); <mask> <mask> if (capacity() == size()) { <mask> makeSize(size() + 1, &t, offset); <mask> this->setSize(this->size() + 1); <mask> } else { <mask> makeSize(size() + 1); <mask> detail::moveObjectsRight(data() + offset, <mask> data() + size(), <mask> data() + size() + 1); <mask> this->setSize(size() + 1); <mask> data()[offset] = std::move(t); <mask> } <mask> return begin() + offset; </s> [sdk33] Update iOS with RN 0.59 </s> remove detail::moveObjectsRight(data() + offset, data() + size(), data() + size() + distance); </s> add detail::moveObjectsRight( data() + offset, data() + size(), data() + size() + distance); </s> remove detail::moveObjectsRight(data() + offset, data() + size(), data() + size() + n); </s> add detail::moveObjectsRight( data() + offset, data() + size(), data() + size() + n); </s> remove new (end()) value_type(std::move(t)); </s> add new (end()) value_type(std::forward<Args>(args)...); </s> remove makeSize(std::max(size_type(2), 3 * size() / 2), &t, size()); </s> add // Any of args may be references into the vector. // When we are reallocating, we have to be careful to construct the new // element before modifying the data in the old buffer. makeSize( size() + 1, [&](void* p) { new (p) value_type(std::forward<Args>(args)...); }, size()); </s> remove private: /* * This is doing the same like emplace_back, but we need this helper * to catch the special case - see the next overload function.. */ template<class ...Args> void emplaceBack(Args&&... args) { makeSize(size() + 1); new (end()) value_type(std::forward<Args>(args)...); this->setSize(size() + 1); } </s> add private:
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep keep replace replace replace keep keep keep keep keep
<mask> <mask> iterator insert(const_iterator pos, size_type n, value_type const& val) { <mask> auto offset = pos - begin(); <mask> makeSize(size() + n); <mask> detail::moveObjectsRight(data() + offset, <mask> data() + size(), <mask> data() + size() + n); <mask> this->setSize(size() + n); <mask> std::generate_n(begin() + offset, n, [&] { return val; }); <mask> return begin() + offset; <mask> } <mask> </s> [sdk33] Update iOS with RN 0.59 </s> remove detail::moveObjectsRight(data() + offset, data() + size(), data() + size() + distance); </s> add detail::moveObjectsRight( data() + offset, data() + size(), data() + size() + distance); </s> remove makeSize(size() + 1); detail::moveObjectsRight(data() + offset, data() + size(), data() + size() + 1); </s> add detail::moveObjectsRight( data() + offset, data() + size(), data() + size() + 1); </s> remove makeSize(size() + 1, &t, offset); </s> add makeSize( size() + 1, [&t](void* ptr) { new (ptr) value_type(std::move(t)); }, offset); </s> remove template<class Arg> </s> add template <class Arg> </s> remove iterator insertImpl(iterator pos, size_type n, const value_type& val, std::true_type) { </s> add iterator insertImpl(iterator pos, size_type n, const value_type& val, std::true_type) { </s> remove detail::populateMemForward(begin() + size(), sz - size(), [&] (void* p) { new (p) value_type(v); } ); </s> add detail::populateMemForward( begin() + size(), sz - size(), [&](void* p) { new (p) value_type(v); });
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep keep replace keep keep keep keep keep
<mask> std::generate_n(begin() + offset, n, [&] { return val; }); <mask> return begin() + offset; <mask> } <mask> <mask> template<class Arg> <mask> iterator insert(const_iterator p, Arg arg1, Arg arg2) { <mask> // Forward using std::is_arithmetic to get to the proper <mask> // implementation; this disambiguates between the iterators and <mask> // (size_t, value_type) meaning for this function. <mask> return insertImpl(unconst(p), arg1, arg2, std::is_arithmetic<Arg>()); </s> [sdk33] Update iOS with RN 0.59 </s> remove template<class Arg> explicit small_vector(Arg arg1, Arg arg2) { </s> add small_vector(size_type n, value_type const& t) { doConstruct(n, [&](void* p) { new (p) value_type(t); }); } template <class Arg> explicit small_vector(Arg arg1, Arg arg2) { </s> remove explicit small_vector(size_type n, value_type const& t = value_type()) { doConstruct(n, t); </s> add explicit small_vector(size_type n) { doConstruct(n, [&](void* p) { new (p) value_type(); }); </s> remove detail::moveObjectsRight(data() + offset, data() + size(), data() + size() + n); </s> add detail::moveObjectsRight( data() + offset, data() + size(), data() + size() + n); </s> remove iterator insertImpl(iterator pos, size_type n, const value_type& val, std::true_type) { </s> add iterator insertImpl(iterator pos, size_type n, const value_type& val, std::true_type) { </s> remove template<class Arg> </s> add template <class Arg> </s> remove makeSize(size() + 1); detail::moveObjectsRight(data() + offset, data() + size(), data() + size() + 1); </s> add detail::moveObjectsRight( data() + offset, data() + size(), data() + size() + 1);
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep keep replace keep keep keep keep keep
<mask> return unconst(q); <mask> } <mask> <mask> iterator erase(const_iterator q1, const_iterator q2) { <mask> if (q1 == q2) return unconst(q1); <mask> std::move(unconst(q2), end(), unconst(q1)); <mask> for (auto it = (end() - std::distance(q1, q2)); it != end(); ++it) { <mask> it->~value_type(); <mask> } <mask> this->setSize(size() - (q2 - q1)); </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 iterator end() const { return iterator(nullptr); } const_iterator cbegin() const { return begin(); } const_iterator cend() const { return end(); } </s> add iterator end() const { return iterator(nullptr); } const_iterator cbegin() const { return begin(); } const_iterator cend() const { return end(); } </s> remove iterator begin() { return data(); } iterator end() { return data() + size(); } const_iterator begin() const { return data(); } const_iterator end() const { return data() + size(); } const_iterator cbegin() const { return begin(); } const_iterator cend() const { return end(); } </s> add iterator begin() { return data(); } iterator end() { return data() + size(); } const_iterator begin() const { return data(); } const_iterator end() const { return data() + size(); } const_iterator cbegin() const { return begin(); } const_iterator cend() const { return end(); } </s> remove iterator end() { return iterator(this, capacity_); } const_iterator end() const { return const_iterator(this, capacity_); } </s> add iterator end() { return iterator(this, capacity_); } const_iterator end() const { return const_iterator(this, capacity_); } </s> remove const_iterator cend() const { return end(); } </s> add const_iterator cend() const { return end(); } </s> remove return numEntries_.readFull() - numErases_.load(std::memory_order_relaxed); </s> add return numEntries_.readFull() - numErases_.load(std::memory_order_relaxed);
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep keep replace keep keep keep keep keep
<mask> void clear() { <mask> erase(begin(), end()); <mask> } <mask> <mask> template<class Arg> <mask> void assign(Arg first, Arg last) { <mask> clear(); <mask> insert(end(), first, last); <mask> } <mask> </s> [sdk33] Update iOS with RN 0.59 </s> remove template<class InputIterator> </s> add template <class InputIterator> </s> remove if (std::is_same<categ,std::input_iterator_tag>::value) { </s> add if (std::is_same<categ, std::input_iterator_tag>::value) { </s> remove template<class Arg> explicit small_vector(Arg arg1, Arg arg2) { </s> add small_vector(size_type n, value_type const& t) { doConstruct(n, [&](void* p) { new (p) value_type(t); }); } template <class Arg> explicit small_vector(Arg arg1, Arg arg2) { </s> remove void clear() { resize(0); } </s> add void clear() { resize(0); } </s> remove if (std::is_same<categ,std::input_iterator_tag>::value) { </s> add if (std::is_same<categ, std::input_iterator_tag>::value) { </s> remove template<class T> typename std::enable_if< FOLLY_IS_TRIVIALLY_COPYABLE(T) >::type </s> add template <class T> typename std::enable_if<folly::is_trivially_copyable<T>::value>::type
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep keep replace replace replace replace keep keep keep keep keep
<mask> clear(); <mask> insert(end(), n, t); <mask> } <mask> <mask> reference front() { assert(!empty()); return *begin(); } <mask> reference back() { assert(!empty()); return *(end() - 1); } <mask> const_reference front() const { assert(!empty()); return *begin(); } <mask> const_reference back() const { assert(!empty()); return *(end() - 1); } <mask> <mask> reference operator[](size_type i) { <mask> assert(i < size()); <mask> return *(begin() + i); <mask> } </s> [sdk33] Update iOS with RN 0.59 </s> remove value_type& front() { return *begin(); } </s> add value_type& front() { return *begin(); } </s> remove const value_type& front() const { return *begin(); } </s> add const value_type& front() const { return *begin(); } </s> remove const_reverse_iterator crend() const { return rend(); } </s> add const_reverse_iterator crend() const { return rend(); } </s> remove std::__throw_out_of_range("index out of range"); </s> add throw_exception<std::out_of_range>("index out of range"); </s> remove enforce(n <= size(), std::__throw_out_of_range, ""); </s> add enforce<std::out_of_range>(n < size(), ""); </s> remove bool empty() const { return size() == 0; } </s> add bool empty() const { return size() == 0; }
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> <mask> reference at(size_type i) { <mask> if (i >= size()) { <mask> std::__throw_out_of_range("index out of range"); <mask> } <mask> return (*this)[i]; <mask> } <mask> <mask> const_reference at(size_type i) const { </s> [sdk33] Update iOS with RN 0.59 </s> remove std::__throw_out_of_range("index out of range"); </s> add throw_exception<std::out_of_range>("index out of range"); </s> remove enforce(n <= size(), std::__throw_out_of_range, ""); </s> add enforce<std::out_of_range>(n < size(), ""); </s> remove reference front() { assert(!empty()); return *begin(); } reference back() { assert(!empty()); return *(end() - 1); } const_reference front() const { assert(!empty()); return *begin(); } const_reference back() const { assert(!empty()); return *(end() - 1); } </s> add reference front() { assert(!empty()); return *begin(); } reference back() { assert(!empty()); return *(end() - 1); } const_reference front() const { assert(!empty()); return *begin(); } const_reference back() const { assert(!empty()); return *(end() - 1); } </s> remove enforce(n < size(), std::__throw_out_of_range, ""); </s> add enforce<std::out_of_range>(n < size(), ""); </s> remove void clear() { resize(0); } </s> add void clear() { resize(0); } </s> remove bool empty() const { return size() == 0; } </s> add bool empty() const { return size() == 0; }
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep replace keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace keep
<mask> const_reference at(size_type i) const { <mask> if (i >= size()) { <mask> std::__throw_out_of_range("index out of range"); <mask> } <mask> return (*this)[i]; <mask> } <mask> <mask> private: <mask> <mask> /* <mask> * This is doing the same like emplace_back, but we need this helper <mask> * to catch the special case - see the next overload function.. <mask> */ <mask> template<class ...Args> <mask> void emplaceBack(Args&&... args) { <mask> makeSize(size() + 1); <mask> new (end()) value_type(std::forward<Args>(args)...); <mask> this->setSize(size() + 1); <mask> } <mask> <mask> static iterator unconst(const_iterator it) { </s> [sdk33] Update iOS with RN 0.59 </s> remove std::__throw_out_of_range("index out of range"); </s> add throw_exception<std::out_of_range>("index out of range"); </s> remove new (end()) value_type(std::move(t)); </s> add new (end()) value_type(std::forward<Args>(args)...); </s> remove makeSize(std::max(size_type(2), 3 * size() / 2), &t, size()); </s> add // Any of args may be references into the vector. // When we are reallocating, we have to be careful to construct the new // element before modifying the data in the old buffer. makeSize( size() + 1, [&](void* p) { new (p) value_type(std::forward<Args>(args)...); }, size()); </s> remove // call helper function for static dispatch of special cases emplaceBack(std::forward<Args>(args)...); } void emplace_back(const value_type& t) { push_back(t); } void emplace_back(value_type& t) { push_back(t); } void emplace_back(value_type&& t) { push_back(std::move(t)); } void push_back(value_type&& t) { </s> add </s> remove makeSize(size() + 1); detail::moveObjectsRight(data() + offset, data() + size(), data() + size() + 1); </s> add detail::moveObjectsRight( data() + offset, data() + size(), data() + size() + 1);
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep replace replace replace replace replace replace replace replace replace keep keep replace keep keep keep keep
<mask> <mask> /* <mask> * g++ doesn't allow you to bind a non-const reference to a member <mask> * of a packed structure, presumably because it would make it too <mask> * easy to accidentally make an unaligned memory access? <mask> */ <mask> template<class T> static T& unpackHack(T* p) { <mask> return *p; <mask> } <mask> <mask> // The std::false_type argument is part of disambiguating the <mask> // iterator insert functions from integral types (see insert().) <mask> template<class It> <mask> iterator insertImpl(iterator pos, It first, It last, std::false_type) { <mask> typedef typename std::iterator_traits<It>::iterator_category categ; <mask> if (std::is_same<categ,std::input_iterator_tag>::value) { <mask> auto offset = pos - begin(); </s> [sdk33] Update iOS with RN 0.59 </s> remove if (std::is_same<categ,std::input_iterator_tag>::value) { </s> add if (std::is_same<categ, std::input_iterator_tag>::value) { </s> remove template<class It> </s> add template <class It> </s> remove if (std::is_same<categ,std::input_iterator_tag>::value) { </s> add if (std::is_same<categ, std::input_iterator_tag>::value) { </s> remove * Move objects in memory to the right into some uninitialized * memory, where the region overlaps. This doesn't just use * std::move_backward because move_backward only works if all the * memory is initialized to type T already. </s> add * Move a range to a range of uninitialized memory. Assumes the * ranges don't overlap. Inserts an element at out + pos using * emplaceFunc(). out will contain (end - begin) + 1 elements on success and * none on failure. If emplaceFunc() throws [begin, end) is unmodified. </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();
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep keep replace keep keep keep keep keep
<mask> // iterator insert functions from integral types (see insert().) <mask> template<class It> <mask> iterator insertImpl(iterator pos, It first, It last, std::false_type) { <mask> typedef typename std::iterator_traits<It>::iterator_category categ; <mask> if (std::is_same<categ,std::input_iterator_tag>::value) { <mask> auto offset = pos - begin(); <mask> while (first != last) { <mask> pos = insert(pos, *first++); <mask> ++pos; <mask> } </s> [sdk33] Update iOS with RN 0.59 </s> remove template<class It> </s> add template <class It> </s> remove /* * g++ doesn't allow you to bind a non-const reference to a member * of a packed structure, presumably because it would make it too * easy to accidentally make an unaligned memory access? */ template<class T> static T& unpackHack(T* p) { return *p; } </s> add </s> remove if (std::is_same<categ,std::input_iterator_tag>::value) { </s> add if (std::is_same<categ, std::input_iterator_tag>::value) { </s> remove template<class It> </s> add template <class It> </s> remove iterator insertImpl(iterator pos, size_type n, const value_type& val, std::true_type) { </s> add iterator insertImpl(iterator pos, size_type n, const value_type& val, std::true_type) { </s> remove detail::moveObjectsRight(data() + offset, data() + size(), data() + size() + n); </s> add detail::moveObjectsRight( data() + offset, data() + size(), data() + size() + n);
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep keep replace replace replace keep keep keep keep keep
<mask> <mask> auto distance = std::distance(first, last); <mask> auto offset = pos - begin(); <mask> makeSize(size() + distance); <mask> detail::moveObjectsRight(data() + offset, <mask> data() + size(), <mask> data() + size() + distance); <mask> this->setSize(size() + distance); <mask> std::copy_n(first, distance, begin() + offset); <mask> return begin() + offset; <mask> } <mask> </s> [sdk33] Update iOS with RN 0.59 </s> remove detail::moveObjectsRight(data() + offset, data() + size(), data() + size() + n); </s> add detail::moveObjectsRight( data() + offset, data() + size(), data() + size() + n); </s> remove makeSize(size() + 1); detail::moveObjectsRight(data() + offset, data() + size(), data() + size() + 1); </s> add detail::moveObjectsRight( data() + offset, data() + size(), data() + size() + 1); </s> remove makeSize(size() + 1, &t, offset); </s> add makeSize( size() + 1, [&t](void* ptr) { new (ptr) value_type(std::move(t)); }, offset); </s> remove iterator insertImpl(iterator pos, size_type n, const value_type& val, std::true_type) { </s> add iterator insertImpl(iterator pos, size_type n, const value_type& val, std::true_type) { </s> remove detail::populateMemForward(begin() + size(), sz - size(), [&] (void* p) { new (p) value_type(v); } ); </s> add detail::populateMemForward( begin() + size(), sz - size(), [&](void* p) { new (p) value_type(v); }); </s> remove iterator begin() { return data(); } iterator end() { return data() + size(); } const_iterator begin() const { return data(); } const_iterator end() const { return data() + size(); } const_iterator cbegin() const { return begin(); } const_iterator cend() const { return end(); } </s> add iterator begin() { return data(); } iterator end() { return data() + size(); } const_iterator begin() const { return data(); } const_iterator end() const { return data() + size(); } const_iterator cbegin() const { return begin(); } const_iterator cend() const { return end(); }
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep keep replace replace keep keep keep keep keep
<mask> std::copy_n(first, distance, begin() + offset); <mask> return begin() + offset; <mask> } <mask> <mask> iterator insertImpl(iterator pos, size_type n, const value_type& val, <mask> std::true_type) { <mask> // The true_type means this should call the size_t,value_type <mask> // overload. (See insert().) <mask> return insert(pos, n, val); <mask> } <mask> </s> [sdk33] Update iOS with RN 0.59 </s> remove doConstruct(n, val); </s> add doConstruct(n, [&](void* p) { new (p) value_type(val); }); } /* * Compute the size after growth. */ size_type computeNewSize() const { return std::min((3 * capacity()) / 2 + 1, max_size()); </s> remove detail::moveObjectsRight(data() + offset, data() + size(), data() + size() + n); </s> add detail::moveObjectsRight( data() + offset, data() + size(), data() + size() + n); </s> remove detail::moveObjectsRight(data() + offset, data() + size(), data() + size() + distance); </s> add detail::moveObjectsRight( data() + offset, data() + size(), data() + size() + distance); </s> remove template<class Arg> </s> add template <class Arg> </s> remove size_type size() const { return this->doSize(); } bool empty() const { return !size(); } </s> add size_type size() const { return this->doSize(); } bool empty() const { return !size(); } </s> remove iterator begin() { return data(); } iterator end() { return data() + size(); } const_iterator begin() const { return data(); } const_iterator end() const { return data() + size(); } const_iterator cbegin() const { return begin(); } const_iterator cend() const { return end(); } </s> add iterator begin() { return data(); } iterator end() { return data() + size(); } const_iterator begin() const { return data(); } const_iterator end() const { return data() + size(); } const_iterator cbegin() const { return begin(); } const_iterator cend() const { return end(); }
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep replace keep keep replace keep keep
<mask> // of disambiguating an overload (see the comment in the <mask> // constructor). <mask> template<class It> <mask> void constructImpl(It first, It last, std::false_type) { <mask> typedef typename std::iterator_traits<It>::iterator_category categ; <mask> if (std::is_same<categ,std::input_iterator_tag>::value) { <mask> // With iterators that only allow a single pass, we can't really <mask> // do anything sane here. </s> [sdk33] Update iOS with RN 0.59 </s> remove template<class It> </s> add template <class It> </s> remove if (std::is_same<categ,std::input_iterator_tag>::value) { </s> add if (std::is_same<categ, std::input_iterator_tag>::value) { </s> remove /* * g++ doesn't allow you to bind a non-const reference to a member * of a packed structure, presumably because it would make it too * easy to accidentally make an unaligned memory access? */ template<class T> static T& unpackHack(T* p) { return *p; } </s> add </s> remove return IsAscii::value ? in | 0x20 : std::tolower(in); </s> add return IsAscii::value ? in | 0x20 : char(std::tolower(in)); </s> remove /* * This helper returns the distance between two iterators if it is * possible to figure it out without messing up the range * (i.e. unless they are InputIterators). Otherwise this returns * -1. */ template<class Iterator> int distance_if_multipass(Iterator first, Iterator last) { typedef typename std::iterator_traits<Iterator>::iterator_category categ; if (std::is_same<categ,std::input_iterator_tag>::value) return -1; return std::distance(first, last); } template<class OurContainer, class Vector, class GrowthPolicy> typename OurContainer::iterator insert_with_hint(OurContainer& sorted, Vector& cont, typename OurContainer::iterator hint, typename OurContainer::value_type&& value, GrowthPolicy& po) { const typename OurContainer::value_compare& cmp(sorted.value_comp()); if (hint == cont.end() || cmp(value, *hint)) { if (hint == cont.begin()) { po.increase_capacity(cont, cont.begin()); return cont.insert(cont.begin(), std::move(value)); } if (cmp(*(hint - 1), value)) { hint = po.increase_capacity(cont, hint); return cont.insert(hint, std::move(value)); } </s> add template <typename Compare, typename Key, typename T> struct sorted_vector_enable_if_is_transparent< void_t<typename Compare::is_transparent>, Compare, Key, T> { using type = T; }; // This wrapper goes around a GrowthPolicy and provides iterator // preservation semantics, but only if the growth policy is not the // default (i.e. nothing). template <class Policy> struct growth_policy_wrapper : private Policy { template <class Container, class Iterator> Iterator increase_capacity(Container& c, Iterator desired_insertion) { typedef typename Container::difference_type diff_t; diff_t d = desired_insertion - c.begin(); Policy::increase_capacity(c); return c.begin() + d; } }; template <> struct growth_policy_wrapper<void> { template <class Container, class Iterator> Iterator increase_capacity(Container&, Iterator it) { return it; } }; /* * This helper returns the distance between two iterators if it is * possible to figure it out without messing up the range * (i.e. unless they are InputIterators). Otherwise this returns * -1. */ template <class Iterator> int distance_if_multipass(Iterator first, Iterator last) { typedef typename std::iterator_traits<Iterator>::iterator_category categ; if (std::is_same<categ, std::input_iterator_tag>::value) { return -1; } return std::distance(first, last); } template <class OurContainer, class Vector, class GrowthPolicy> typename OurContainer::iterator insert_with_hint( OurContainer& sorted, Vector& cont, typename OurContainer::iterator hint, typename OurContainer::value_type&& value, GrowthPolicy& po) { const typename OurContainer::value_compare& cmp(sorted.value_comp()); if (hint == cont.end() || cmp(value, *hint)) { if (hint == cont.begin() || cmp(*(hint - 1), value)) { hint = po.increase_capacity(cont, hint); return cont.insert(hint, std::move(value)); } else {
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep keep replace replace replace keep keep keep keep keep
<mask> auto distance = std::distance(first, last); <mask> makeSize(distance); <mask> this->setSize(distance); <mask> try { <mask> detail::populateMemForward(data(), distance, <mask> [&] (void* p) { new (p) value_type(*first++); } <mask> ); <mask> } catch (...) { <mask> if (this->isExtern()) { <mask> u.freeHeap(); <mask> } <mask> throw; </s> [sdk33] Update iOS with RN 0.59 </s> remove detail::populateMemForward(data(), n, [&] (void* p) { new (p) value_type(val); } ); </s> add detail::populateMemForward(data(), n, std::forward<InitFunc>(func)); </s> remove void doConstruct(size_type n, value_type const& val) { </s> add template <typename InitFunc> void doConstruct(size_type n, InitFunc&& func) { </s> remove detail::populateMemForward(begin() + size(), sz - size(), [&] (void* p) { new (p) value_type(); } ); </s> add detail::populateMemForward( begin() + size(), sz - size(), [&](void* p) { new (p) value_type(); }); </s> remove detail::populateMemForward(begin() + size(), sz - size(), [&] (void* p) { new (p) value_type(v); } ); </s> add detail::populateMemForward( begin() + size(), sz - size(), [&](void* p) { new (p) value_type(v); }); </s> remove // move old elements to the left of the new one try { detail::moveToUninitialized(begin(), begin() + pos, newp); } catch (...) { newp[pos].~value_type(); free(newh); throw; } // move old elements to the right of the new one try { if (pos < size-1) { detail::moveToUninitialized(begin() + pos, end(), newp + pos + 1); } } catch (...) { for (size_type i = 0; i <= pos; ++i) { newp[i].~value_type(); } free(newh); throw; } } else { // move without inserting new element try { detail::moveToUninitialized(begin(), end(), newp); } catch (...) { free(newh); throw; </s> add try { if (insert) { // move and insert the new element this->moveToUninitializedEmplace( begin(), end(), newp, pos, std::forward<EmplaceFunc>(emplaceFunc)); } else { // move without inserting new element this->moveToUninitialized(begin(), end(), newp); </s> add } catch (...) { free(newh); throw;
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep keep replace keep keep keep replace replace replace keep keep keep keep
<mask> throw; <mask> } <mask> } <mask> <mask> void doConstruct(size_type n, value_type const& val) { <mask> makeSize(n); <mask> this->setSize(n); <mask> try { <mask> detail::populateMemForward(data(), n, <mask> [&] (void* p) { new (p) value_type(val); } <mask> ); <mask> } catch (...) { <mask> if (this->isExtern()) { <mask> u.freeHeap(); <mask> } </s> [sdk33] Update iOS with RN 0.59 </s> remove detail::populateMemForward(data(), distance, [&] (void* p) { new (p) value_type(*first++); } ); </s> add detail::populateMemForward( data(), distance, [&](void* p) { new (p) value_type(*first++); }); </s> remove detail::populateMemForward(begin() + size(), sz - size(), [&] (void* p) { new (p) value_type(); } ); </s> add detail::populateMemForward( begin() + size(), sz - size(), [&](void* p) { new (p) value_type(); }); </s> remove detail::populateMemForward(begin() + size(), sz - size(), [&] (void* p) { new (p) value_type(v); } ); </s> add detail::populateMemForward( begin() + size(), sz - size(), [&](void* p) { new (p) value_type(v); }); </s> remove // move old elements to the left of the new one try { detail::moveToUninitialized(begin(), begin() + pos, newp); } catch (...) { newp[pos].~value_type(); free(newh); throw; } // move old elements to the right of the new one try { if (pos < size-1) { detail::moveToUninitialized(begin() + pos, end(), newp + pos + 1); } } catch (...) { for (size_type i = 0; i <= pos; ++i) { newp[i].~value_type(); } free(newh); throw; } } else { // move without inserting new element try { detail::moveToUninitialized(begin(), end(), newp); } catch (...) { free(newh); throw; </s> add try { if (insert) { // move and insert the new element this->moveToUninitializedEmplace( begin(), end(), newp, pos, std::forward<EmplaceFunc>(emplaceFunc)); } else { // move without inserting new element this->moveToUninitialized(begin(), end(), newp); </s> add } catch (...) { free(newh); throw;
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep replace keep keep replace replace keep keep keep keep
<mask> // overload. <mask> void constructImpl(size_type n, value_type const& val, std::true_type) { <mask> doConstruct(n, val); <mask> } <mask> <mask> void makeSize(size_type size, value_type* v = nullptr) { <mask> makeSize(size, v, size - 1); <mask> } <mask> <mask> /* <mask> * Ensure we have a large enough memory region to be size `size'. </s> [sdk33] Update iOS with RN 0.59 </s> remove * Ensure we have a large enough memory region to be size `size'. </s> add * Ensure we have a large enough memory region to be size `newSize'. </s> remove iterator insertImpl(iterator pos, size_type n, const value_type& val, std::true_type) { </s> add iterator insertImpl(iterator pos, size_type n, const value_type& val, std::true_type) { </s> remove if (size <= this->capacity()) { </s> add if (newSize <= capacity()) { assert(!insert); </s> remove template<class Arg> explicit small_vector(Arg arg1, Arg arg2) { </s> add small_vector(size_type n, value_type const& t) { doConstruct(n, [&](void* p) { new (p) value_type(t); }); } template <class Arg> explicit small_vector(Arg arg1, Arg arg2) { </s> remove explicit small_vector(size_type n, value_type const& t = value_type()) { doConstruct(n, t); </s> add explicit small_vector(size_type n) { doConstruct(n, [&](void* p) { new (p) value_type(); });
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep keep replace keep keep keep keep keep
<mask> makeSize(size, v, size - 1); <mask> } <mask> <mask> /* <mask> * Ensure we have a large enough memory region to be size `size'. <mask> * Will move/copy elements if we are spilling to heap_ or needed to <mask> * allocate a new region, but if resized in place doesn't initialize <mask> * anything in the new region. In any case doesn't change size(). <mask> * Supports insertion of new element during reallocation by given <mask> * pointer to new element and position of new element. </s> [sdk33] Update iOS with RN 0.59 </s> remove * NOTE: If reallocation is not needed, and new element should be * inserted in the middle of vector (not at the end), do the move * objects and insertion outside the function, otherwise exception is thrown. </s> add * NOTE: If reallocation is not needed, insert must be false, * because we only know how to emplace elements into new memory. </s> remove void makeSize(size_type size, value_type* v = nullptr) { makeSize(size, v, size - 1); </s> add void makeSize(size_type newSize) { makeSizeInternal(newSize, false, [](void*) { assume_unreachable(); }, 0); } template <typename EmplaceFunc> void makeSize(size_type newSize, EmplaceFunc&& emplaceFunc, size_type pos) { assert(size() == capacity()); makeSizeInternal( newSize, true, std::forward<EmplaceFunc>(emplaceFunc), pos); </s> remove makeSize(std::max(size_type(2), 3 * size() / 2), &t, size()); </s> add // Any of args may be references into the vector. // When we are reallocating, we have to be careful to construct the new // element before modifying the data in the old buffer. makeSize( size() + 1, [&](void* p) { new (p) value_type(std::forward<Args>(args)...); }, size()); </s> remove doConstruct(n, val); </s> add doConstruct(n, [&](void* p) { new (p) value_type(val); }); } /* * Compute the size after growth. */ size_type computeNewSize() const { return std::min((3 * capacity()) / 2 + 1, max_size()); </s> remove void makeSize(size_type size, value_type* v, size_type pos) { if (size > this->max_size()) { </s> add template <typename EmplaceFunc> void makeSizeInternal( size_type newSize, bool insert, EmplaceFunc&& emplaceFunc, size_type pos) { if (newSize > max_size()) { </s> remove * Move objects in memory to the right into some uninitialized * memory, where the region overlaps. This doesn't just use * std::move_backward because move_backward only works if all the * memory is initialized to type T already. </s> add * Move a range to a range of uninitialized memory. Assumes the * ranges don't overlap. Inserts an element at out + pos using * emplaceFunc(). out will contain (end - begin) + 1 elements on success and * none on failure. If emplaceFunc() throws [begin, end) is unmodified.
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep replace replace replace keep replace replace keep
<mask> * Supports insertion of new element during reallocation by given <mask> * pointer to new element and position of new element. <mask> * NOTE: If reallocation is not needed, and new element should be <mask> * inserted in the middle of vector (not at the end), do the move <mask> * objects and insertion outside the function, otherwise exception is thrown. <mask> */ <mask> void makeSize(size_type size, value_type* v, size_type pos) { <mask> if (size > this->max_size()) { <mask> throw std::length_error("max_size exceeded in small_vector"); </s> [sdk33] Update iOS with RN 0.59 </s> remove * Ensure we have a large enough memory region to be size `size'. </s> add * Ensure we have a large enough memory region to be size `newSize'. </s> remove if (size <= this->capacity()) { </s> add if (newSize <= capacity()) { assert(!insert); </s> remove // move old elements to the left of the new one try { detail::moveToUninitialized(begin(), begin() + pos, newp); } catch (...) { newp[pos].~value_type(); free(newh); throw; } // move old elements to the right of the new one try { if (pos < size-1) { detail::moveToUninitialized(begin() + pos, end(), newp + pos + 1); } } catch (...) { for (size_type i = 0; i <= pos; ++i) { newp[i].~value_type(); } free(newh); throw; } } else { // move without inserting new element try { detail::moveToUninitialized(begin(), end(), newp); } catch (...) { free(newh); throw; </s> add try { if (insert) { // move and insert the new element this->moveToUninitializedEmplace( begin(), end(), newp, pos, std::forward<EmplaceFunc>(emplaceFunc)); } else { // move without inserting new element this->moveToUninitialized(begin(), end(), newp); </s> remove makeSize(std::max(size_type(2), 3 * size() / 2), &t, size()); </s> add // Any of args may be references into the vector. // When we are reallocating, we have to be careful to construct the new // element before modifying the data in the old buffer. makeSize( size() + 1, [&](void* p) { new (p) value_type(std::forward<Args>(args)...); }, size()); </s> remove heapifyCapacity ? detail::shiftPointer(newh, kHeapifyCapacitySize) : newh); if (v != nullptr) { // move new element try { new (&newp[pos]) value_type(std::move(*v)); } catch (...) { free(newh); throw; } </s> add heapifyCapacity ? detail::shiftPointer(newh, kHeapifyCapacitySize) : newh);
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep replace keep keep keep replace keep keep keep
<mask> throw std::length_error("max_size exceeded in small_vector"); <mask> } <mask> if (size <= this->capacity()) { <mask> return; <mask> } <mask> <mask> auto needBytes = size * sizeof(value_type); <mask> // If the capacity isn't explicitly stored inline, but the heap <mask> // allocation is grown to over some threshold, we should store <mask> // a capacity at the front of the heap allocation. </s> [sdk33] Update iOS with RN 0.59 </s> remove !kHasInlineCapacity && needBytes > kHeapifyCapacityThreshold; </s> add !kHasInlineCapacity && needBytes > kHeapifyCapacityThreshold; </s> remove InternalSizeType* getCapacity() { </s> add InternalSizeType getCapacity() const { </s> remove void makeSize(size_type size, value_type* v, size_type pos) { if (size > this->max_size()) { </s> add template <typename EmplaceFunc> void makeSizeInternal( size_type newSize, bool insert, EmplaceFunc&& emplaceFunc, size_type pos) { if (newSize > max_size()) { </s> remove } FOLLY_PACK_ATTR; </s> add void setCapacity(InternalSizeType c) { capacity_ = c; } } FOLLY_SV_PACK_ATTR; </s> remove * NOTE: If reallocation is not needed, and new element should be * inserted in the middle of vector (not at the end), do the move * objects and insertion outside the function, otherwise exception is thrown. </s> add * NOTE: If reallocation is not needed, insert must be false, * because we only know how to emplace elements into new memory.
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep keep replace keep keep keep keep keep
<mask> // If the capacity isn't explicitly stored inline, but the heap <mask> // allocation is grown to over some threshold, we should store <mask> // a capacity at the front of the heap allocation. <mask> bool heapifyCapacity = <mask> !kHasInlineCapacity && needBytes > kHeapifyCapacityThreshold; <mask> if (heapifyCapacity) { <mask> needBytes += kHeapifyCapacitySize; <mask> } <mask> auto const sizeBytes = goodMallocSize(needBytes); <mask> void* newh = checkedMalloc(sizeBytes); </s> [sdk33] Update iOS with RN 0.59 </s> remove auto needBytes = size * sizeof(value_type); </s> add assert(this->kShouldUseHeap); // This branch isn't needed for correctness, but allows the optimizer to // skip generating code for the rest of this function in NoHeap // small_vectors. if (!this->kShouldUseHeap) { return; } newSize = std::max(newSize, computeNewSize()); auto needBytes = newSize * sizeof(value_type); </s> remove if (size <= this->capacity()) { </s> add if (newSize <= capacity()) { assert(!insert); </s> remove InternalSizeType* getCapacity() { </s> add InternalSizeType getCapacity() const { </s> remove } FOLLY_PACK_ATTR; </s> add void setCapacity(InternalSizeType c) { capacity_ = c; } } FOLLY_SV_PACK_ATTR; </s> remove static size_t const kHeapifyCapacitySize = sizeof( typename std::aligned_storage< sizeof(InternalSizeType), alignof(value_type) >::type); </s> add static size_t constexpr kHeapifyCapacitySize = sizeof( typename std:: aligned_storage<sizeof(InternalSizeType), alignof(value_type)>::type); </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*); };
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep keep replace replace replace replace replace replace replace replace replace replace 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 keep
<mask> // use its least significant bit as a flag. <mask> assert(!detail::pointerFlagGet(newh)); <mask> <mask> value_type* newp = static_cast<value_type*>( <mask> heapifyCapacity ? <mask> detail::shiftPointer(newh, kHeapifyCapacitySize) : <mask> newh); <mask> <mask> if (v != nullptr) { <mask> // move new element <mask> try { <mask> new (&newp[pos]) value_type(std::move(*v)); <mask> } catch (...) { <mask> free(newh); <mask> throw; <mask> } <mask> <mask> // move old elements to the left of the new one <mask> try { <mask> detail::moveToUninitialized(begin(), begin() + pos, newp); <mask> } catch (...) { <mask> newp[pos].~value_type(); <mask> free(newh); <mask> throw; <mask> } <mask> <mask> // move old elements to the right of the new one <mask> try { <mask> if (pos < size-1) { <mask> detail::moveToUninitialized(begin() + pos, end(), newp + pos + 1); <mask> } <mask> } catch (...) { <mask> for (size_type i = 0; i <= pos; ++i) { <mask> newp[i].~value_type(); <mask> } <mask> free(newh); <mask> throw; <mask> } <mask> } else { <mask> // move without inserting new element <mask> try { <mask> detail::moveToUninitialized(begin(), end(), newp); <mask> } catch (...) { <mask> free(newh); <mask> throw; <mask> } </s> [sdk33] Update iOS with RN 0.59 </s> add } catch (...) { free(newh); throw; </s> remove for (std::size_t i = 0; i < idx; ++i) { mem[i].~T(); </s> add for (SizeType i = 0; i <= pos; ++i) { out[i].~T(); </s> remove for (size_t i = 0; i < n; ++i) { op(&mem[idx]); ++idx; </s> add if (begin + pos < end) { this->moveToUninitialized(begin + pos, end, out + pos + 1); </s> remove detail::populateMemForward(data(), distance, [&] (void* p) { new (p) value_type(*first++); } ); </s> add detail::populateMemForward( data(), distance, [&](void* p) { new (p) value_type(*first++); }); </s> remove detail::populateMemForward(data(), n, [&] (void* p) { new (p) value_type(val); } ); </s> add detail::populateMemForward(data(), n, std::forward<InitFunc>(func));
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep add keep keep keep keep keep keep
<mask> this->moveToUninitialized(begin(), end(), newp); <mask> } <mask> } <mask> for (auto& val : *this) { <mask> val.~value_type(); <mask> } <mask> <mask> if (this->isExtern()) { </s> [sdk33] Update iOS with RN 0.59 </s> remove // move old elements to the left of the new one try { detail::moveToUninitialized(begin(), begin() + pos, newp); } catch (...) { newp[pos].~value_type(); free(newh); throw; } // move old elements to the right of the new one try { if (pos < size-1) { detail::moveToUninitialized(begin() + pos, end(), newp + pos + 1); } } catch (...) { for (size_type i = 0; i <= pos; ++i) { newp[i].~value_type(); } free(newh); throw; } } else { // move without inserting new element try { detail::moveToUninitialized(begin(), end(), newp); } catch (...) { free(newh); throw; </s> add try { if (insert) { // move and insert the new element this->moveToUninitializedEmplace( begin(), end(), newp, pos, std::forward<EmplaceFunc>(emplaceFunc)); } else { // move without inserting new element this->moveToUninitialized(begin(), end(), newp); </s> remove explicit NodeRecycler() : refs_(0), dirty_(false) { lock_.init(); } </s> add explicit NodeRecycler() : refs_(0), dirty_(false) { lock_.init(); } </s> remove return *u.getCapacity(); </s> add return u.getCapacity(); </s> remove for (auto& pair : x) { </s> add for (const auto& pair : x) { </s> remove for (auto& item : x) { </s> add for (const auto& item : x) { </s> remove detail::populateMemForward(data(), n, [&] (void* p) { new (p) value_type(val); } ); </s> add detail::populateMemForward(data(), n, std::forward<InitFunc>(func));
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep replace keep keep keep replace
<mask> assert(newCapacity < std::numeric_limits<InternalSizeType>::max()); <mask> *u.getCapacity() = InternalSizeType(newCapacity); <mask> } <mask> } <mask> <mask> private: </s> [sdk33] Update iOS with RN 0.59 </s> remove } </s> add } // namespace folly </s> remove private: </s> add private: </s> remove }} // namespaces </s> add } // namespace detail } // namespace folly </s> remove private: </s> add private: </s> remove NodeAlloc& alloc() { return alloc_; } </s> add NodeAlloc& alloc() { return alloc_; }
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep keep replace replace keep keep keep keep keep
<mask> struct HeapPtrWithCapacity { <mask> void* heap_; <mask> InternalSizeType capacity_; <mask> <mask> InternalSizeType* getCapacity() { <mask> return &capacity_; <mask> } <mask> } FOLLY_PACK_ATTR; <mask> <mask> struct HeapPtr { <mask> // Lower order bit of heap_ is used as flag to indicate whether capacity is </s> [sdk33] Update iOS with RN 0.59 </s> remove } FOLLY_PACK_ATTR; </s> add void setCapacity(InternalSizeType c) { capacity_ = c; } } FOLLY_SV_PACK_ATTR; </s> remove InternalSizeType* getCapacity() { </s> add InternalSizeType getCapacity() const { </s> remove private: </s> add private: </s> remove return static_cast<InternalSizeType*>( detail::pointerFlagClear(heap_)); </s> add return *static_cast<InternalSizeType*>(detail::pointerFlagClear(heap_)); } void setCapacity(InternalSizeType c) { *static_cast<InternalSizeType*>(detail::pointerFlagClear(heap_)) = c; </s> remove InternalSizeType* getCapacity() { </s> add InternalSizeType getCapacity() const { </s> remove InternalSizeType* getCapacity() const { return const_cast<Data*>(this)->getCapacity(); </s> add void setCapacity(InternalSizeType c) { pdata_.setCapacity(c);
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> InternalSizeType* getCapacity() { <mask> return &capacity_; <mask> } <mask> } FOLLY_PACK_ATTR; <mask> <mask> struct HeapPtr { <mask> // Lower order bit of heap_ is used as flag to indicate whether capacity is <mask> // stored at the front of the heap allocation. <mask> void* heap_; </s> [sdk33] Update iOS with RN 0.59 </s> remove InternalSizeType* getCapacity() { </s> add InternalSizeType getCapacity() const { </s> remove InternalSizeType* getCapacity() { return &capacity_; </s> add InternalSizeType getCapacity() const { return capacity_; </s> remove !kHasInlineCapacity && needBytes > kHeapifyCapacityThreshold; </s> add !kHasInlineCapacity && needBytes > kHeapifyCapacityThreshold; </s> remove auto needBytes = size * sizeof(value_type); </s> add assert(this->kShouldUseHeap); // This branch isn't needed for correctness, but allows the optimizer to // skip generating code for the rest of this function in NoHeap // small_vectors. if (!this->kShouldUseHeap) { return; } newSize = std::max(newSize, computeNewSize()); auto needBytes = newSize * sizeof(value_type); </s> remove private: </s> add private: </s> remove return static_cast<InternalSizeType*>( detail::pointerFlagClear(heap_)); </s> add return *static_cast<InternalSizeType*>(detail::pointerFlagClear(heap_)); } void setCapacity(InternalSizeType c) { *static_cast<InternalSizeType*>(detail::pointerFlagClear(heap_)) = c;
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep replace keep replace replace
<mask> void* heap_; <mask> <mask> InternalSizeType* getCapacity() { <mask> assert(detail::pointerFlagGet(heap_)); <mask> return static_cast<InternalSizeType*>( <mask> detail::pointerFlagClear(heap_)); </s> [sdk33] Update iOS with RN 0.59 </s> remove private: </s> add private: </s> remove InternalSizeType* getCapacity() { return &capacity_; </s> add InternalSizeType getCapacity() const { return capacity_; </s> remove } FOLLY_PACK_ATTR; </s> add } FOLLY_SV_PACK_ATTR; </s> remove } FOLLY_PACK_ATTR; </s> add void setCapacity(InternalSizeType c) { capacity_ = c; } } FOLLY_SV_PACK_ATTR; </s> remove InternalSizeType* getCapacity() { </s> add InternalSizeType getCapacity() const {
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep replace keep replace replace replace keep keep keep
<mask> } <mask> } FOLLY_PACK_ATTR; <mask> <mask> #if (FOLLY_X64 || FOLLY_PPC64) <mask> typedef unsigned char InlineStorageDataType[sizeof(value_type) * MaxInline]; <mask> #else <mask> typedef typename std::aligned_storage< <mask> sizeof(value_type) * MaxInline, <mask> alignof(value_type) </s> [sdk33] Update iOS with RN 0.59 </s> remove sizeof(value_type) * MaxInline, alignof(value_type) >::type InlineStorageDataType; #endif </s> add sizeof(value_type) * MaxInline, alignof(value_type)>::type InlineStorageDataType; </s> remove return static_cast<InternalSizeType*>( detail::pointerFlagClear(heap_)); </s> add return *static_cast<InternalSizeType*>(detail::pointerFlagClear(heap_)); } void setCapacity(InternalSizeType c) { *static_cast<InternalSizeType*>(detail::pointerFlagClear(heap_)) = c; </s> remove static size_t const kHeapifyCapacitySize = sizeof( typename std::aligned_storage< sizeof(InternalSizeType), alignof(value_type) >::type); </s> add static size_t constexpr kHeapifyCapacitySize = sizeof( typename std:: aligned_storage<sizeof(InternalSizeType), alignof(value_type)>::type); </s> remove #include <folly/portability/TypeTraits.h> </s> add #if (FOLLY_X64 || FOLLY_PPC64) #define FOLLY_SV_PACK_ATTR FOLLY_PACK_ATTR #define FOLLY_SV_PACK_PUSH FOLLY_PACK_PUSH #define FOLLY_SV_PACK_POP FOLLY_PACK_POP #else #define FOLLY_SV_PACK_ATTR #define FOLLY_SV_PACK_PUSH #define FOLLY_SV_PACK_POP #endif </s> remove sizeof(value_type) * MaxInline != 0, InlineStorageDataType, void* >::type InlineStorageType; </s> add sizeof(value_type) * MaxInline != 0, InlineStorageDataType, void*>::type InlineStorageType;
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep replace replace replace replace keep keep replace replace replace replace keep keep
<mask> typedef unsigned char InlineStorageDataType[sizeof(value_type) * MaxInline]; <mask> #else <mask> typedef typename std::aligned_storage< <mask> sizeof(value_type) * MaxInline, <mask> alignof(value_type) <mask> >::type InlineStorageDataType; <mask> #endif <mask> <mask> typedef typename std::conditional< <mask> sizeof(value_type) * MaxInline != 0, <mask> InlineStorageDataType, <mask> void* <mask> >::type InlineStorageType; <mask> <mask> static bool const kHasInlineCapacity = </s> [sdk33] Update iOS with RN 0.59 </s> remove #if (FOLLY_X64 || FOLLY_PPC64) typedef unsigned char InlineStorageDataType[sizeof(value_type) * MaxInline]; #else </s> add </s> remove } FOLLY_PACK_ATTR; </s> add } FOLLY_SV_PACK_ATTR; </s> remove static bool const kHasInlineCapacity = sizeof(HeapPtrWithCapacity) < sizeof(InlineStorageType); </s> add static bool constexpr kHasInlineCapacity = sizeof(HeapPtrWithCapacity) < sizeof(InlineStorageType); </s> remove static size_t const kHeapifyCapacitySize = sizeof( typename std::aligned_storage< sizeof(InternalSizeType), alignof(value_type) >::type); </s> add static size_t constexpr kHeapifyCapacitySize = sizeof( typename std:: aligned_storage<sizeof(InternalSizeType), alignof(value_type)>::type); </s> remove return static_cast<InternalSizeType*>( detail::pointerFlagClear(heap_)); </s> add return *static_cast<InternalSizeType*>(detail::pointerFlagClear(heap_)); } void setCapacity(InternalSizeType c) { *static_cast<InternalSizeType*>(detail::pointerFlagClear(heap_)) = c;
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep replace replace keep keep replace replace replace replace replace keep keep
<mask> <mask> static bool const kHasInlineCapacity = <mask> sizeof(HeapPtrWithCapacity) < sizeof(InlineStorageType); <mask> <mask> // This value should we multiple of word size. <mask> static size_t const kHeapifyCapacitySize = sizeof( <mask> typename std::aligned_storage< <mask> sizeof(InternalSizeType), <mask> alignof(value_type) <mask> >::type); <mask> // Threshold to control capacity heapifying. <mask> static size_t const kHeapifyCapacityThreshold = </s> [sdk33] Update iOS with RN 0.59 </s> remove static size_t const kHeapifyCapacityThreshold = 100 * kHeapifyCapacitySize; </s> add static size_t constexpr kHeapifyCapacityThreshold = 100 * kHeapifyCapacitySize; </s> remove sizeof(value_type) * MaxInline != 0, InlineStorageDataType, void* >::type InlineStorageType; </s> add sizeof(value_type) * MaxInline != 0, InlineStorageDataType, void*>::type InlineStorageType; </s> remove typedef typename std::conditional< kHasInlineCapacity, HeapPtrWithCapacity, HeapPtr >::type PointerType; </s> add typedef typename std:: conditional<kHasInlineCapacity, HeapPtrWithCapacity, HeapPtr>::type PointerType; </s> remove static RefCounted * reallocate(Char *const data, const size_t currentSize, const size_t currentCapacity, const size_t newCapacity) { FBSTRING_ASSERT(newCapacity > 0 && newCapacity > currentSize); </s> add static RefCounted* reallocate( Char* const data, const size_t currentSize, const size_t currentCapacity, size_t* newCapacity) { FBSTRING_ASSERT(*newCapacity > 0 && *newCapacity > currentSize); const size_t allocNewCapacity = goodMallocSize(getDataOffset() + (*newCapacity + 1) * sizeof(Char)); </s> remove template<typename NodeAlloc, typename U, typename=typename std::enable_if<std::is_convertible<U, T>::value>::type> static SkipListNode* create( NodeAlloc& alloc, int height, U&& data, bool isHead = false) { </s> add template < typename NodeAlloc, typename U, typename = typename std::enable_if<std::is_convertible<U, T>::value>::type> static SkipListNode* create(NodeAlloc& alloc, int height, U&& data, bool isHead = false) {
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep replace replace keep replace replace replace replace replace keep keep keep keep
<mask> // Threshold to control capacity heapifying. <mask> static size_t const kHeapifyCapacityThreshold = <mask> 100 * kHeapifyCapacitySize; <mask> <mask> typedef typename std::conditional< <mask> kHasInlineCapacity, <mask> HeapPtrWithCapacity, <mask> HeapPtr <mask> >::type PointerType; <mask> <mask> union Data { <mask> explicit Data() { pdata_.heap_ = 0; } <mask> </s> [sdk33] Update iOS with RN 0.59 </s> remove explicit Data() { pdata_.heap_ = 0; } </s> add explicit Data() { pdata_.heap_ = nullptr; } </s> remove static size_t const kHeapifyCapacitySize = sizeof( typename std::aligned_storage< sizeof(InternalSizeType), alignof(value_type) >::type); </s> add static size_t constexpr kHeapifyCapacitySize = sizeof( typename std:: aligned_storage<sizeof(InternalSizeType), alignof(value_type)>::type); </s> add Data() {} </s> remove InternalSizeType* getCapacity() { return &capacity_; </s> add InternalSizeType getCapacity() const { return capacity_; </s> remove sizeof(value_type) * MaxInline != 0, InlineStorageDataType, void* >::type InlineStorageType; </s> add sizeof(value_type) * MaxInline != 0, InlineStorageDataType, void*>::type InlineStorageType;
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h
keep keep keep keep replace keep keep keep keep keep
<mask> HeapPtr <mask> >::type PointerType; <mask> <mask> union Data { <mask> explicit Data() { pdata_.heap_ = 0; } <mask> <mask> PointerType pdata_; <mask> InlineStorageType storage_; <mask> <mask> value_type* buffer() noexcept { </s> [sdk33] Update iOS with RN 0.59 </s> remove typedef typename std::conditional< kHasInlineCapacity, HeapPtrWithCapacity, HeapPtr >::type PointerType; </s> add typedef typename std:: conditional<kHasInlineCapacity, HeapPtrWithCapacity, HeapPtr>::type PointerType; </s> add Data() {} </s> remove explicit basic_fbstring(const A&) noexcept { } </s> add explicit basic_fbstring(const A&) noexcept {} </s> add } else { return static_cast<value_type*>(detail::shiftPointer( detail::pointerFlagClear(pdata_.heap_), kHeapifyCapacitySize)); </s> remove return static_cast<value_type*>( detail::shiftPointer( detail::pointerFlagClear(pdata_.heap_), kHeapifyCapacitySize)); </s> add </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/small_vector.h
keep keep keep add keep keep keep keep keep
<mask> } <mask> value_type* heap() noexcept { <mask> if (kHasInlineCapacity || !detail::pointerFlagGet(pdata_.heap_)) { <mask> return static_cast<value_type*>(pdata_.heap_); <mask> } <mask> } <mask> value_type const* heap() const noexcept { <mask> return const_cast<Data*>(this)->heap(); <mask> } </s> [sdk33] Update iOS with RN 0.59 </s> remove return static_cast<value_type*>( detail::shiftPointer( detail::pointerFlagClear(pdata_.heap_), kHeapifyCapacitySize)); </s> add </s> remove template<class ...Args> </s> add template <class... Args> </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 if (parent_) { LockPolicy::unlock(parent_->mutex_); } </s> add assignImpl(*this, rhs); return *this; } </s> remove const value_type *first() const { </s> add const value_type* first() const { </s> remove explicit Data() { pdata_.heap_ = 0; } </s> add explicit Data() { pdata_.heap_ = nullptr; }
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/small_vector.h