summaryrefslogtreecommitdiff
path: root/src/common (follow)
Commit message (Collapse)AuthorAgeFilesLines
* fiber: Double default stack sizeGravatar MerryMage2021-03-101-1/+1
| | | | Stack overflow occurs with some guest applications
* common: Fiber: use a reference for YieldTo.Gravatar bunnei2021-03-072-8/+6
| | | | - Fixes another small leak.
* common: fiber: Use weak_ptr when yielding.Gravatar bunnei2021-03-052-8/+13
| | | | | - Avoids a memory leak, as taking a strong reference of the fiber here causes a circular reference. - Supersedes #6006 with a more narrow fix.
* Revert "core: Switch to unique_ptr for usage of Common::Fiber."Gravatar bunnei2021-03-052-9/+9
|
* Merge pull request #6006 from bunnei/fiber-unique-ptrGravatar bunnei2021-03-042-9/+9
|\ | | | | core: Switch to unique_ptr for usage of Common::Fiber.
| * core: Switch to unique_ptr for usage of Common::Fiber.Gravatar bunnei2021-02-272-9/+9
| | | | | | | | | | - 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.
* | [network] Error handling reformGravatar comex2021-02-282-16/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `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.
* | Merge pull request #5984 from jbeich/gcc-freebsdGravatar bunnei2021-02-271-0/+1
|\ \ | |/ |/| common,video-core: unbreak GCC 11 build on FreeBSD 13
| * common: add missing header after f3805376f726Gravatar Jan Beich2021-02-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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); | ^~~~~~
* | Merge pull request #5953 from bunnei/memory-refactor-1Gravatar bunnei2021-02-273-0/+256
|\ \ | |/ |/| Kernel Rework: Memory updates and refactoring (Part 1)
| * common: Add implementation of TinyMT (Mersenne Twister RNG).Gravatar bunnei2021-02-182-0/+251
| |
| * common: alignment: Add DivideUp utility method.Gravatar bunnei2021-02-181-0/+5
| |
* | common: wall_clock: Fix integer overflow with StandardWallClock.Gravatar bunnei2021-02-192-7/+28
|/ | | | | - 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.
* common/cityhash: Use common typesGravatar ReinUsesLisp2021-02-182-114/+98
| | | | | | | | 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.
* common: wall_clock: Optimize GetClockCycles/GetCPUCycles to use a single MUL ↵Gravatar bunnei2021-02-151-8/+9
| | | | instruction.
* common: Merge uint128 to a single header file with inlines.Gravatar bunnei2021-02-154-135/+84
|
* common: Add -fsized-deallocation as a Clang flagGravatar lat9nq2021-02-091-0/+2
| | | | Prevents an operator delete error when compiling with Clang 11.
* string_util: Remove MSVC workaround for converting between UTF8/UTF16Gravatar Morph2021-02-081-14/+0
| | | | This has been fixed as of Visual Studio 2019 Version 16.2
* Merge pull request #5885 from MerryMage/ring_buffer-granularityGravatar bunnei2021-02-061-11/+10
|\ | | | | ring_buffer: Remove granularity template argument
| * ring_buffer: Remove granularity template argumentGravatar MerryMage2021-02-061-11/+10
| | | | | | | | | | | | 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
* | hle: kernel: Drop R_UNLESS_NOLOG in favor of expanded if-statement.Gravatar bunnei2021-02-051-8/+0
| |
* | common: scope_exit: Add a cancellable ScopeExit macro.Gravatar bunnei2021-02-051-0/+6
| |
* | common: common_funcs: Add R_UNLESS_NOLOG for scenarios that should not log.Gravatar bunnei2021-02-051-0/+8
|/
* common: common_funcs: Change R_UNLESS to LOG_ERROR.Gravatar bunnei2021-01-281-1/+1
|
* common: common_funcs: Log error on R_UNLESS.Gravatar bunnei2021-01-281-0/+3
|
* common: common_funcs: Add useful kernel macro R_SUCCEED_IF.Gravatar bunnei2021-01-281-0/+3
|
* common: common_funcs: Add a few more useful macros for kernel code.Gravatar bunnei2021-01-281-0/+11
|
* Merge pull request #5778 from ReinUsesLisp/shader-dirGravatar bunnei2021-01-273-0/+39
|\ | | | | renderer_opengl: Avoid precompiled cache and force NV GL cache directory
| * renderer_opengl: Avoid precompiled cache and force NV GL cache directoryGravatar ReinUsesLisp2021-01-213-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Setting __GL_SHADER_DISK_CACHE_PATH we can force the cache directory to be in yuzu's user directory to stop commonly distributed malware from deleting our driver shader cache. And by setting __GL_SHADER_DISK_CACHE_SKIP_CLEANUP we can have an unbounded shader cache size. This has only been implemented on Windows, mostly because previous tests didn't seem to work on Linux. Disable the precompiled cache on Nvidia's driver. There's no need to hide information the driver already has in its own cache.
* | common: Add missing include to bit_util.hGravatar bunnei2021-01-211-0/+1
| |
* | bit_util: Unify implementations of MostSignificantBit32/MostSignificantBit64Gravatar Lioncash2021-01-211-35/+13
|/ | | | | | We can use the standardized CLZ facilities to perform this. This also allows us to make utilizing functions constexpr and eliminate the inclusion of an intrinsics header.
* Merge pull request #5360 from ReinUsesLisp/enforce-memclass-accessGravatar bunnei2021-01-171-2/+2
|\ | | | | core: Silence Wclass-memaccess warnings and enforce it
| * core: Silence Wclass-memaccess warningsGravatar ReinUsesLisp2021-01-151-2/+2
| | | | | | | | | | This requires making several types trivial and properly initialize them whenever they are called.
* | Merge pull request #5275 from FernandoS27/fast-native-clockGravatar bunnei2021-01-155-104/+174
|\ \ | | | | | | X86/NativeClock: Improve performance of clock calculations on hot path.
| * | X86/NativeClock: Reimplement RTDSC access to be lock free.Gravatar Fernando Sahmkow2021-01-025-103/+107
| | |
| * | X86/NativeClock: Improve performance of clock calculations on hot path.Gravatar Fernando Sahmkow2021-01-022-5/+71
| | |
* | | Merge pull request #5336 from lioncash/treeGravatar bunnei2021-01-152-841/+668
|\ \ \ | | | | | | | | common/tree: Convert defines over to templates
| * | | common/tree: Convert defines over to templatesGravatar Lioncash2021-01-122-592/+666
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reworks the tree header to operate off of templates as opposed to a series of defines. This allows all tree facilities to obey namespacing rules, and also allows this code to be used within modules once compiler support is in place. This also gets rid to use a macro to define functions and structs for necessary data types. With templates, these will be generated when they're actually used, eliminating the need for the separate declaration.
| * | | common/tree: Remove unused splay tree definesGravatar Lioncash2021-01-121-249/+2
| | | | | | | | | | | | | | | | Makes for less code to take care of.
* | | | Merge pull request #5358 from ReinUsesLisp/rename-insert-paddingGravatar LC2021-01-151-4/+4
|\ \ \ \ | | |_|/ | |/| | common/common_funcs: Rename INSERT_UNION_PADDING_{BYTES,WORDS} to _NOINIT
| * | | common/common_funcs: Rename INSERT_UNION_PADDING_{BYTES,WORDS} to _NOINITGravatar ReinUsesLisp2021-01-151-4/+4
| | | | | | | | | | | | | | | | INSERT_PADDING_BYTES_NOINIT is more descriptive of the underlying behavior.
* | | | Merge pull request #5355 from lioncash/timerGravatar bunnei2021-01-153-202/+0
|\ \ \ \ | | | | | | | | | | common/timer: Remove
| * | | | common/timer: RemoveGravatar Lioncash2021-01-153-202/+0
| |/ / / | | | | | | | | | | | | | | | | This is a leftover from citra and dolphin that isn't used at all, particularly given the <chrono> header exists.
* | | | Merge pull request #5357 from ReinUsesLisp/alignment-log2Gravatar LC2021-01-151-17/+12
|\ \ \ \ | | | | | | | | | | common/alignment: Rename AlignBits to AlignUpLog2 and use constraints
| * | | | common/alignment: Upgrade to use constraints instead of static assertsGravatar ReinUsesLisp2021-01-151-13/+9
| | | | |
| * | | | common/alignment: Rename AlignBits to AlignUpLog2Gravatar ReinUsesLisp2021-01-151-5/+4
| | | | | | | | | | | | | | | | | | | | AlignUpLog2 describes what the function does better than AlignBits.
* | | | | common/bit_util: Replace CLZ/CTZ operations with standardized onesGravatar Lioncash2021-01-151-76/+0
| |/ / / |/| | | | | | | | | | | Makes for less code that we need to maintain.
* | | | common/color: RemoveGravatar ReinUsesLisp2021-01-152-272/+0
|/ / / | | | | | | | | | This is a leftover from Citra we no longer use.
* | | Merge pull request #5280 from FearlessTobi/port-5666Gravatar bunnei2021-01-121-4/+12
|\ \ \ | |/ / |/| | Port citra-emu/citra#5666: "Rotate previous log file to "citra_log.txt.old""
| * | Address review commentsGravatar FearlessTobi2021-01-041-5/+5
| | |