mirror of
https://github.com/valentderah/totk-pc-recomp.git
synced 2026-11-22 05:05:56 +00:00
Make code comments say what they mean instead of pointing at things a reader cannot follow
Comments cited codes from local notes (port-lessons P1, backlog), task labels (T6c1-T6c3, M4), bare upstream commit hashes and issue numbers, a file that no longer exists (nvn_api.c, now nvn_api_*.c), a generated file (main_0103.c) and line numbers into upstream files that refs/ has moved past, so they pointed at unrelated code. Those now name the file, function or project and say what the cited code does. Attribution of copied code keeps its pinned commits. Corrected facts: TOTK_REPLAY_ASYNC defaults to 0, and the shader cache, pipeline cache and pipeline keys live next to totk.exe, not in build/v121. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d3fd4c5944
commit
ce150130df
28 files changed
+95
-86
No files matched your search
+4
-4
@@ -963,10 +963,10 @@ void kern_core_back(int *away) {
|
||||
// A pass of a guest loop that polls memory until another thread changes it. On the Switch it fills only its own core,
|
||||
// where a better thread pinned there preempts it; here it holds a virtual core and a host core, and pollers that take a
|
||||
// lock on every pass hand its cache line between their host cores so the thread whose item it is rarely gets it
|
||||
// (nxnative 6d34984, Breath of the Wild's job queue). Every pass pauses the host core once. A wait is a run of passes
|
||||
// through the same loop at most SPIN_GAP_NS apart; once one has lasted TOTK_SPIN_HANDOFF_US (default 50) and a thread
|
||||
// waits for a virtual core, each pass gives the core to the waiter, whatever its priority, yields the host CPU and
|
||||
// takes a core again. Shorter waits keep the core: a lock held for a moment would otherwise make the next pass wait
|
||||
// (nxnative found this in Breath of the Wild's job queue). Every pass pauses the host core once. A wait is a run of
|
||||
// passes through the same loop at most SPIN_GAP_NS apart; once one has lasted TOTK_SPIN_HANDOFF_US (default 50) and a
|
||||
// thread waits for a virtual core, each pass gives the core to the waiter, whatever its priority, yields the host CPU
|
||||
// and takes a core again. Shorter waits keep the core: a lock held for a moment would otherwise make the next pass wait
|
||||
// for another thread's next SVC (MacNativeGames). TOTK_SPIN=0 keeps the core always (the gate's own cost only).
|
||||
#define SPIN_GAP_NS 20000ull
|
||||
static int g_spin_on = -1;
|
||||
|
||||
Reference in new issue
Block a user