summaryrefslogtreecommitdiff
path: root/src/common
AgeCommit message (Collapse)Author
2021-05-11common: tree: Avoid a nullptr dereference.bunnei
2021-05-05fixup! common: bit_util: Add BIT macro.bunnei
2021-05-05common: parent_of_member: Fix build for OffsetOf().bunnei
2021-05-05fixup! common: intrusive_red_black_tree: Disable static_assert that will not ↵bunnei
evaluate as constant on MSVC.
2021-05-05common: Rename NON_COPYABLE/NON_MOVABLE with YUZU_ prefix.bunnei
2021-05-05common: common_funcs: Add Size helper function.bunnei
2021-05-05common: bit_util: Add BIT macro.bunnei
2021-05-05common: intrusive_red_black_tree: Disable static_assert that will not ↵bunnei
evaluate as constant on MSVC.
2021-05-05common: common_funcs: Add helper macros for non-copyable and non-moveable.bunnei
- Useful for scenarios where we do not want to inherit from NonCopyable.
2021-04-20log/backend: Use in-class initializer for FileBackendLioncash
We can also avoid redundant constructions of the same string repeatedly.
2021-04-20log/backend: Make use of erase_ifLioncash
Same behavior, but less verbose.
2021-04-14Merge pull request #6199 from lioncash/log-nsbunnei
common/log: Move Log namespace into the Common namespace
2021-04-14log/backend: Correct order of const in copy constructorLioncash
Follows our predominant coding style. Also explicitly specifies the move constructor/assignment operator as well.
2021-04-14common/log: Move Log namespace into the Common namespaceLioncash
Forgot to move this over when I moved the rest of the source files with lacking namespaces over.
2021-04-14common: Move settings to common from core.bunnei
- Removes a dependency on core and input_common from common.
2021-04-14core: settings: Add setting for debug assertions and disable by default.bunnei
- This is a developer-only setting and no longer needs to be enabled by default. - Also adds "use_auto_stub" setting to SDL frontend while we are here. - Supersedes #1340.
2021-04-12nvidia_flags: Add missing header guardLioncash
Prevents potential inclusion compilation errors.
2021-04-10Merge pull request #6099 from bunnei/derive-membunnei
Kernel Rework: Derive memory regions from board layout.
2021-04-09Merge pull request #6162 from degasus/no_spin_loopsbunnei
video_core: Avoid spin loops.
2021-04-09bgtc: Update to 12.x and implement OpenTaskServiceMorph
2021-04-07common/threadsafe_queue: Provide Wait() method.Markus Wick
It shall block until there is something to consume in the queue. And use it for the GPU emulation instead of the spin loop. This is only in booting the emulator, however in BOTW this is the case for about 1 second.
2021-04-04common: Move assert failure handling into a cpp file.Markus Wick
Advantage: Altering the handler does not need a full recompilation. Disadvantage: noreturn is droped, so the caller is a bit slower. We quite often run yuzu with a YOLO assertion handler. In fact, only very few games run at all with asserts. This patch allows developers to patch the handler without recompiling everything. The overhead of the missing "noreturn" attribute shoul be negletable.
2021-03-23common: common_sizes: Move sizes to the Common namespace.bunnei
2021-03-21common: common_sizes: Move Invalid to Size_* prefix and add missing values.bunnei
2021-03-21hle: kernel: board: k_system_control: Extend to include memory region sizes.bunnei
2021-03-21common: Move common sizes to their own header for code reuse.bunnei
2021-03-10fiber: Double default stack sizeMerryMage
Stack overflow occurs with some guest applications
2021-03-07common: Fiber: use a reference for YieldTo.bunnei
- Fixes another small leak.
2021-03-05common: fiber: Use weak_ptr when yielding.bunnei
- Avoids a memory leak, as taking a strong reference of the fiber here causes a circular reference. - Supersedes #6006 with a more narrow fix.
2021-03-05Revert "core: Switch to unique_ptr for usage of Common::Fiber."bunnei
2021-03-04Merge pull request #6006 from bunnei/fiber-unique-ptrbunnei
core: Switch to unique_ptr for usage of Common::Fiber.
2021-02-28[network] Error handling reformcomex
`network.cpp` has several error paths which either: - report "Unhandled host socket error=n" and return `SUCCESS`, or - switch on a few possible errors, log them, and translate them to Errno; the same switch statement is copied and pasted in multiple places in the code Convert these paths to use a helper function `GetAndLogLastError`, which is roughly the equivalent of one of the switch statements, but: - handling more cases (both ones that were already in `Errno`, and a few more I added), and - using OS functions to convert the error to a string when logging, so it'll describe the error even if it's not one of the ones in the switch statement. - To handle this, refactor the logic in `GetLastErrorMsg` to expose a new function `NativeErrorToString` which takes the error number explicitly as an argument. And improve the Windows version a bit. Also, add a test which exercises two random error paths.
2021-02-27Merge pull request #5984 from jbeich/gcc-freebsdbunnei
common,video-core: unbreak GCC 11 build on FreeBSD 13
2021-02-27core: Switch to unique_ptr for usage of Common::Fiber.bunnei
- With using unique_ptr instead of shared_ptr, we have more explicit ownership of the context. - Fixes a memory leak due to circular reference of the shared pointer.
2021-02-27Merge pull request #5953 from bunnei/memory-refactor-1bunnei
Kernel Rework: Memory updates and refactoring (Part 1)
2021-02-23common: add missing header after f3805376f726Jan Beich
In file included from src/video_core/dma_pusher.cpp:5: src/./common/cityhash.h:69:47: error: 'size_t' has not been declared 69 | [[nodiscard]] u64 CityHash64(const char* buf, size_t len); | ^~~~~~ src/./common/cityhash.h:73:55: error: 'size_t' has not been declared 73 | [[nodiscard]] u64 CityHash64WithSeed(const char* buf, size_t len, u64 seed); | ^~~~~~ src/./common/cityhash.h:77:56: error: 'size_t' has not been declared 77 | [[nodiscard]] u64 CityHash64WithSeeds(const char* buf, size_t len, u64 seed0, u64 seed1); | ^~~~~~ src/./common/cityhash.h:80:47: error: 'size_t' has not been declared 80 | [[nodiscard]] u128 CityHash128(const char* s, size_t len); | ^~~~~~ src/./common/cityhash.h:84:55: error: 'size_t' has not been declared 84 | [[nodiscard]] u128 CityHash128WithSeed(const char* s, size_t len, u128 seed); | ^~~~~~
2021-02-19common: wall_clock: Fix integer overflow with StandardWallClock.bunnei
- Previous optimized impl. resulted in an integer overflow, so revert. - This is our slow/fallback path that should never be really be used, so the optimization in unimportant.
2021-02-18common: Add implementation of TinyMT (Mersenne Twister RNG).bunnei
2021-02-18common: alignment: Add DivideUp utility method.bunnei
2021-02-18common/cityhash: Use common typesReinUsesLisp
Allow sharing return types with the rest of the code base. For example, we use 'u128 = std::array<u64, 2>', meanwhile Google's code uses 'uint128 = std::pair<u64, u64>'. While we are at it, use size_t instead of std::size_t.
2021-02-15common: wall_clock: Optimize GetClockCycles/GetCPUCycles to use a single MUL ↵bunnei
instruction.
2021-02-15common: Merge uint128 to a single header file with inlines.bunnei
2021-02-09common: Add -fsized-deallocation as a Clang flaglat9nq
Prevents an operator delete error when compiling with Clang 11.
2021-02-08string_util: Remove MSVC workaround for converting between UTF8/UTF16Morph
This has been fixed as of Visual Studio 2019 Version 16.2
2021-02-06Merge pull request #5885 from MerryMage/ring_buffer-granularitybunnei
ring_buffer: Remove granularity template argument
2021-02-06ring_buffer: Remove granularity template argumentMerryMage
Non-obvious bug in RingBuffer::Push(std::vector<T>&) when granularity != 1 Just remove it altogether because we do not have a use for granularity != 1
2021-02-05hle: kernel: Drop R_UNLESS_NOLOG in favor of expanded if-statement.bunnei
2021-02-05common: scope_exit: Add a cancellable ScopeExit macro.bunnei
2021-02-05common: common_funcs: Add R_UNLESS_NOLOG for scenarios that should not log.bunnei
2021-01-28common: common_funcs: Change R_UNLESS to LOG_ERROR.bunnei