2 ms·
Sure. But that counts as "doing your own relocations". Unsafe Rust could do the same, yes?
by quotemstr 6y ago
Sure. But that counts as "doing your own relocations". Unsafe Rust could do the same, yes?
- whimsicalism 6y agoWhat is being relocated?
- ithkuil 6y agoIf you use offsets instead of pointers you're doing relocations "on the fly"
- secondcoming 6y agoI don't know enough about Rust to say. If it doesn't have the concept of a 'fancy pointer' then I assume no, you'd have to essentially reproduce what boost::interprocess does.
- ekimekim 6y agoI'm still learning Rust, but iiuc you could do this by creating an OffsetPtr type that implements the Deref trait (https://doc.rust-lang.org/std/ops/trait.Deref.html https://doc.rust-lang.org/std/ops/trait.Deref.html). This is exactly a "fancy pointer" as you describe.