Skip to content

Share one metadata walk between Mono and IL2CPP - #145

Open
ero-qt wants to merge 15 commits into
LiveSplit:masterfrom
ero-qt:managed-walk
Open

Share one metadata walk between Mono and IL2CPP#145
ero-qt wants to merge 15 commits into
LiveSplit:masterfrom
ero-qt:managed-walk

Conversation

@ero-qt

@ero-qt ero-qt commented Aug 28, 2026

Copy link
Copy Markdown

Depends on #143 and #144.
Part of #141.

Only the last two commits are new: the parity tests and the carve.

The two walks were near copies. field.rs byte-identical, both pointer.rs files the same 160 lines apart from one dereference, class and field lookup line for line. All of it now lives in one private managed module. The genuine differences sit behind a Runtime enum, matched exhaustively, so a future runtime is a compile error at every divergence point. Everything else is written once. Public API stays byte-compatible on both sides, down to FusedIterator vs DoubleEndedIterator on classes().

The parity tests land first on purpose: hand-laid images of both runtimes' structures at real builds' offsets, pinning behavior before any code moved.

Choices worth knowing while reviewing. The internal field lookup returns the declaring class, unused for now, because a follow-up resolves inherited statics against the right static table and shaping the seam once was cheaper. Items in the private module are plain pub, bounded by the module itself. The field entry size is stride, one name for mono's alignment and IL2CPP's struct_size. Mono's field array read now null-checks the way IL2CPP's always did, observable in nothing.

Two doc links to Image that never resolved are fixed in passing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant