[Fix] (MobileGL/Init, MG_Backend): ShutdownSplitRoles exists only under MOBILEGL_BUILD_DISAGGREGATED - G1 admits no new pull symbol and the unconditional call moved DestroyImpl by 32 bytes

This commit is contained in:
2026-09-16 05:54:33 -04:00
parent 7ea3b1d1f1
commit 571cbabb53
3 changed files with 13 additions and 7 deletions
+6 -2
View File
@@ -43,11 +43,15 @@ namespace MobileGL {
if (logLifecycle) { if (logLifecycle) {
MGLOG_I("MobileGL closing..."); MGLOG_I("MobileGL closing...");
} }
#if MOBILEGL_BUILD_DISAGGREGATED
// P5: the split roles come down FIRST - ARCHITECTURE.md:537's order puts the whole // P5: the split roles come down FIRST - ARCHITECTURE.md:537's order puts the whole
// of it before MobileGL::Destroy(), and this function IS MobileGL::Destroy. A no-op // of it before MobileGL::Destroy(), and this function IS MobileGL::Destroy. A no-op
// in a monolith build and in a monolith run; see BackendObjects.h for why the // in a monolith RUN; absent from a monolith BUILD, because G1 admits no new pull
// position rather than the call is the load-bearing part. // symbol and no resized one (the first version called it unconditionally and moved
// DestroyImpl by 32 bytes). See BackendObjects.h for why the position rather than
// the call is the load-bearing part.
MG_Backend::ShutdownSplitRoles(); MG_Backend::ShutdownSplitRoles();
#endif
// Before any subsystem the counters name goes away, and before the last frame's // Before any subsystem the counters name goes away, and before the last frame's
// numbers can be lost: emits the final summary line and, when // numbers can be lost: emits the final summary line and, when
// MOBILEGL_PIPE_STATS_FILE is set, the JSON dump. A no-op when the counters are // MOBILEGL_PIPE_STATS_FILE is set, the JSON dump. A no-op when the counters are
+5 -3
View File
@@ -16,9 +16,10 @@ namespace MobileGL::MG_Backend {
extern UniquePtr<BackendObject>& pActiveBackendObject; extern UniquePtr<BackendObject>& pActiveBackendObject;
extern GlobalBackendFunctionsTable gBackendFunctionsTable; extern GlobalBackendFunctionsTable gBackendFunctionsTable;
// P5 v1. The counterpart of Init()'s single split hook, and a NO-OP in every build and #if MOBILEGL_BUILD_DISAGGREGATED
// every run that is not split - which is why MobileGL/Init.cpp can call it unconditionally // P5 v1. The counterpart of Init()'s single split hook, and a NO-OP in every run that is
// without a second #if in a file no package owns. // not split. It exists ONLY in a split build: G1 admits no new symbol in the pull build,
// so MobileGL/Init.cpp's call sits under the same #if rather than calling a no-op.
// //
// IT MUST RUN FIRST, BEFORE ANYTHING ELSE IN DestroyImpl. ARCHITECTURE.md:537's order is // IT MUST RUN FIRST, BEFORE ANYTHING ELSE IN DestroyImpl. ARCHITECTURE.md:537's order is
// publish -> the server drains and acks -> stop the apply thread (Kill, then join) -> close // publish -> the server drains and acks -> stop the apply thread (Kill, then join) -> close
@@ -38,4 +39,5 @@ namespace MobileGL::MG_Backend {
// client-minted and needs no backend call, which is P10's. CONTRACT-P5 4 flags this as a // client-minted and needs no backend call, which is P10's. CONTRACT-P5 4 flags this as a
// KNOWN OPEN ITEM and asks v1 to record which way it went: P5 keeps today's order. // KNOWN OPEN ITEM and asks v1 to record which way it went: P5 keeps today's order.
void ShutdownSplitRoles(); void ShutdownSplitRoles();
#endif
} // namespace MobileGL::MG_Backend } // namespace MobileGL::MG_Backend
+2 -2
View File
@@ -170,8 +170,8 @@ namespace MobileGL::MG_Backend {
} // namespace } // namespace
#endif #endif
void ShutdownSplitRoles() {
#if MOBILEGL_BUILD_DISAGGREGATED #if MOBILEGL_BUILD_DISAGGREGATED
void ShutdownSplitRoles() {
if (MG_Config::Transport == MG_Config::TransportMode::Monolith) return; if (MG_Config::Transport == MG_Config::TransportMode::Monolith) return;
// ClientSession::Stop IS table 3's whole order and it is idempotent: publish and wait // ClientSession::Stop IS table 3's whole order and it is idempotent: publish and wait
// for the server to drain (bounded - a lost record must be a red lane, not a hung // for the server to drain (bounded - a lost record must be a red lane, not a hung
@@ -181,8 +181,8 @@ namespace MobileGL::MG_Backend {
// owns. A var-tail still named by an unapplied record is a use-after-free the join is // owns. A var-tail still named by an unapplied record is a use-after-free the join is
// what prevents, which is why the order is not a preference. // what prevents, which is why the order is not a preference.
MG_Remote::Client::ClientSessionInstance().Stop(); MG_Remote::Client::ClientSessionInstance().Stop();
#endif
} }
#endif
void Init() { void Init() {
MGLOG_D("Initializing MobileGL Backend..."); MGLOG_D("Initializing MobileGL Backend...");