Skip to content

Add reference element reads - #153

Open
ero-qt wants to merge 8 commits into
LiveSplit:masterfrom
ero-qt:reference-collections
Open

ero-qt wants to merge 8 commits into
LiveSplit:masterfrom
ero-qt:reference-collections

Conversation

@ero-qt

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

Copy link
Copy Markdown
Contributor

Part of #149.

Adds read_reference_array and read_reference_list, which hand back the elements' object addresses, and read_string_object, which reads a string at one of those addresses. read_string is a dereference followed by read_string_object. string[] and List<string> become readable.

Reference elements are pointers at the target's width, so a width claim through read_array compiles at either width and silently answers garbage at the wrong one. These readers own the width. Null elements come back as null addresses at their positions, and only a null collection reference refuses.

Custom-class elements work the same way. The object address plus get_field_offset reads fields directly.

cargo test --all-features runs the suite. The new tests cover reference arrays and lists on both runtimes, lengths past the buffer, nulls kept in place, and string objects at their addresses.


Depends on #152.

@ero-qt
ero-qt force-pushed the reference-collections branch 7 times, most recently from 8bada7e to 02aaa2a Compare September 17, 2026 09:34
@ero-qt
ero-qt force-pushed the reference-collections branch from 02aaa2a to 114b2e2 Compare September 17, 2026 10:18
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