3 ms·
Shouldn't it be "gamedevver" instead? Anyway, on my personal wishlist: Allow customized pointers. For example, if I use a mmapped file that is mapped at a diff
by amelius 11y ago
Shouldn't it be "gamedevver" instead?
Anyway, on my personal wishlist:
Allow customized pointers. For example, if I use a mmapped file that is mapped at a different base address every time it is opened, the pointers within that file are always relative to the base address. I'd like to use "special" pointers inside the mmapped file, that are aware of this. Also, I'd like to use standard data structures (associative arrays, lists, sets) inside the mmapped file, meaning that the solution should be generic.
- pjc50 11y agoThat's a rather difficult sort of generic type to implement: it would have to include the base address in the type somehow.
- JoeAltmaier 11y agoConstruct ptrs with the base address? At that point, why not just use '+' and be done with it.
- masklinn 11y ago> Anyway, on my personal wishlist: Allow customized pointers. It's already there isn't it? Isn't a custom pointer just a stack struct implementing Deref (and possibly DerefMut)?
- doomrobo 11y agoCan't you use raw pointers and .offset()? You can put them in a struct that mutates itself for every method call so it keeps track of the mmap. You'd also probably have to make sure that it has exclusive access to the mmap so another thread won't invalidate its pointers.
- devit 11y agoI think this can be implemented on current Rust, although you will have to define specific array, list and sets for this situation. However, you would probably want a different implementation anyway due to the different performance characteristics of disk/SSD vs RAM.