Skip to content

Commit aa3fa5c

Browse files
docs: clarify GC no-region parameter and byte/bool P/Invoke boundary comments
Agent-Logs-Url: https://github.com/winnerspiros/osu/sessions/2523e170-1d43-41d8-af53-47db9142dcaa Co-authored-by: winnerspiros <1675249+winnerspiros@users.noreply.github.com>
1 parent e650ba3 commit aa3fa5c

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

osu.Android/Native/oboe_bridge.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,10 @@ OSU_EXPORT void nADPFCloseSession(intptr_t sessionPtr) {
841841
// giving an additional ~5% clock-frequency boost at the cost of slightly higher
842842
// power draw — acceptable for an interactive game session.
843843
// preferEfficiency=0 → prefer performance (disable power-efficiency bias).
844+
//
845+
// P/Invoke boundary uses `byte` instead of `bool` because Mono's P/Invoke marshaller
846+
// does not guarantee a 1-byte ABI for C++ `bool`. The native side receives a `byte`
847+
// and converts it via `preferEfficiency != 0` before forwarding to the API's `bool` param.
844848
OSU_EXPORT void nADPFSetPreferPowerEfficiency(intptr_t sessionPtr, byte preferEfficiency) {
845849
if (!sessionPtr) return;
846850

osu.Android/Performance/AndroidHighPerformanceSessionManager.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ private void enterSession()
122122
{
123123
try
124124
{
125+
// disallowFullBlockingGC: false — if allocation exceeds the budget,
126+
// the runtime silently reverts to normal GC instead of throwing.
125127
noGCRegionActive = GC.TryStartNoGCRegion(NO_GC_REGION_BUDGET_BYTES, disallowFullBlockingGC: false);
126128
if (noGCRegionActive)
127129
Logger.Log("High performance session: no-GC region started (64 MB budget)");

0 commit comments

Comments
 (0)