You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to make a function that returns a random available address for memory-mapped IO buffers. However, Rust needs type anotations and I'm not really sure what to do to make them work. I'm using similar code to that of the memory allocator and using an atomic u64 to track the allocator's progress, then using that position to pick the next available frame position, along with an RNG to mix it up a little:
I'm not really sure what I'm doing wrong (and maybe I'm overcomplicating things). I wish I could cash all the frames that I can allocate, but I'm not going to allocate a stack or a heap capable of holding billions of frames, if not more, and I also don't know a way of actually doing that properly anyway, so I'm stuck with iterating on every memory allocation for the time being. Thoughts?
This discussion was converted from issue #891 on December 27, 2020 14:10.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm trying to make a function that returns a random available address for memory-mapped IO buffers. However, Rust needs type anotations and I'm not really sure what to do to make them work. I'm using similar code to that of the memory allocator and using an atomic u64 to track the allocator's progress, then using that position to pick the next available frame position, along with an RNG to mix it up a little:
I'm not really sure what I'm doing wrong (and maybe I'm overcomplicating things). I wish I could cash all the frames that I can allocate, but I'm not going to allocate a stack or a heap capable of holding billions of frames, if not more, and I also don't know a way of actually doing that properly anyway, so I'm stuck with iterating on every memory allocation for the time being. Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions