aboutsummaryrefslogtreecommitdiff
path: root/src/common/fiber.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [fiber] fix windows 11 regression with DefaultSettings due to fiber stack ↵lizzie2026-01-271-3/+9
| | | | | | | | | | | corruption (#3400) Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3400 Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: Maufeat <sahyno1996@gmail.com> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [common, core] remove uneeded memory indirection overhead at startup (#3306)lizzie2026-01-161-70/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for core stuff: just remove unique ptrs that dont need any pointer stability at all (afterall its an allocation within an allocation so yeah) for fibers: Main reasoning behind this is because virtualBuffer<> is stupidly fucking expensive and it also clutters my fstat view ALSO mmap is a syscall, syscalls are bad for performance or whatever ALSO std::vector<> is better suited for handling this kind of "fixed size thing where its like big but not THAT big" (512 KiB isn't going to kill your memory usage for each fiber...) for core.cpp stuff - inlines stuff into std::optional<> as opposed to std::unique_ptr<> (because yknow, we are making the Impl from an unique_ptr, allocating within an allocation is unnecessary) - reorganizes the structures a bit so padding doesnt screw us up (it's not perfect but eh saves a measly 44 bytes) - removes unused/dead code - uses std::vector<> instead of std::deque<> no perf impact expected, maybe some initialisation boost but very minimal impact nonethless lto gets rid of most calls anyways - the heavy issue is with shared_ptr and the cache coherency from the atomics... but i clumped them together because well, they kinda do not suffer from cache coherency - hopefully not a mistake this balloons the size of Impl to about 1.67 MB - which is fine because we throw it in the stack anyways REST OF INTERFACES: most of them ballooned in size as well, but overhead is ok since its an allocation within an alloc, no stack is used (when it comes to storing these i mean) Signed-off-by: lizzie lizzie@eden-emu.dev Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3306 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [common] fix fibers by using older boost instead of minicoro (#2665)lizzie2025-12-291-69/+88
| | | | | | | | | | | | | Revert of a previous commit that added minicoro for a reason god knows why Signed-off-by: lizzie <lizzie@eden-emu.dev> Co-authored-by: Caio Oliveira <caiooliveirafarias0@gmail.com> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2665 Reviewed-by: DraVee <dravee@eden-emu.dev> Reviewed-by: Maufeat <sahyno1996@gmail.com> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* Revert "Disabled MCO_USE_VMEM_ALLOCATOR because standard stack size seems to ↵Briar2025-04-061-0/+1
| | | | | | suffice" This reverts commit ada5dcf01a9cca36c7df8ebf78249b570eb501c9.
* Disabled MCO_USE_VMEM_ALLOCATOR because standard stack size seems to sufficedarktux2025-04-041-1/+0
|
* Save memory by using dyamic stack size in Fiberdarktux2025-04-041-0/+1
|
* clang-formated new fiber.cpp and minicoro.hdarktux2025-04-041-6/+5
|
* Implemented rewindless Fiber without Boost (using minicoro)darktux2025-04-041-85/+69
|
* general: fix spelling mistakesLiam2023-03-121-1/+1
|
* common/fiber: make fibers easier to useLiam2022-07-021-15/+6
|
* general: Convert source file copyright comments over to SPDXMorph2022-04-231-3/+2
| | | | | This formats all copyright comments according to SPDX formatting guidelines. Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
* hle: kernel: Use std::mutex instead of spin locks for most kernel locking.bunnei2022-04-111-2/+3
|
* common: fiber: YieldTo: Avoid hard crash on nullptr previous_fiber.bunnei2022-01-141-1/+4
| | | | - When the emulator crashes to desktop below, we don't even get this captured in a log, making such issues harder to debug.
* fiber: Double default stack sizeMerryMage2021-03-101-1/+1
| | | | Stack overflow occurs with some guest applications
* common: Fiber: use a reference for YieldTo.bunnei2021-03-071-7/+5
| | | | - Fixes another small leak.
* common: fiber: Use weak_ptr when yielding.bunnei2021-03-051-7/+12
| | | | | - 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."bunnei2021-03-051-7/+7
|
* core: Switch to unique_ptr for usage of Common::Fiber.bunnei2021-02-271-7/+7
| | | | | - 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.
* common: fiber: Use VirtualBuffer for stack memory.bunnei2020-11-291-2/+5
| | | | - This will be aligned by default, and helps memory usage.
* common: fiber: Use boost::context instead of native fibers on Windows.bunnei2020-11-291-106/+8
|
* common/fiber: Move all member variables into impl classLioncash2020-11-061-72/+83
| | | | | | Hides all of the implementation details for users of the class. This has the benefit of reducing includes and also making the fiber classes movable again.
* common: Enable warnings as errorsLioncash2020-11-021-4/+4
| | | | Cleans up common so that we can enable warnings as errors.
* common/fiber: Take shared_ptr<Fiber> by copy in YieldToReinUsesLisp2020-10-281-2/+2
| | | | | YieldTo does not intend to modify the passed shared_ptrs. Pass it by copy to keep a reference count while this function executes.
* Core/Common: Address Feedback.Fernando Sahmkow2020-06-271-7/+3
|
* Common/Fiber: Address Feedback and Correct Memory leaks.Fernando Sahmkow2020-06-181-26/+32
|
* Common/Fiber: Implement Rewind on Boost Context.Fernando Sahmkow2020-06-181-2/+37
|
* Common/Fiber: Implement Rewinding.Fernando Sahmkow2020-06-181-2/+30
|
* Common/Fiber: Additional corrections to f_context.Fernando Sahmkow2020-06-181-4/+4
|
* Common/Fiber: Correct f_context based Fibers.Fernando Sahmkow2020-06-181-6/+8
|
* Core/HostTiming: Allow events to be advanced manually.Fernando Sahmkow2020-06-181-1/+1
|
* Common/Tests: Address FeedbackFernando Sahmkow2020-06-181-3/+2
|
* Common: Make MinGW build use Windows Fibers instead of fcontext_tFernando Sahmkow2020-06-181-2/+2
|
* Common/Tests: Clang Format.Fernando Sahmkow2020-06-181-11/+10
|
* Common: Correct fcontext fibers.Fernando Sahmkow2020-06-181-5/+4
|
* Common: Polish Fiber class, add comments, asserts and more tests.Fernando Sahmkow2020-06-181-22/+33
|
* Tests: Add tests for fibers and refactor/fix Fiber classFernando Sahmkow2020-06-181-16/+16
|
* Common: Implement a basic Fiber class.Fernando Sahmkow2020-06-181-0/+147