mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-01-16 00:43:14 -03:00
To ensure memory safety, callers of GetPointer have to perform a bounds check. But how is this bounds check supposed to be performed? GetPointerForRange contained one implementation of a bounds check, but it was cumbersome, and it also isn't obvious why it's correct. To make doing the right thing easier, this commit changes GetPointer to return a span that tells the caller how many bytes it's allowed to access.
17 KiB
17 KiB