Fluffy Hub
- 2 Posts
- 3 Comments
Joined 2 years ago
Cake day: January 28th, 2025
You are not logged in. If you use a Fediverse account that is able to follow users, you can follow this user.
Fluffy Hub@programming.devOPto
Rust@programming.dev•When you begin writing Rust like this...English
2·1 year agoHere is an update. I focused on the Node which is the smallest element of the buffer, it is what contains any meta data and the data payload. The code is heavily reduced but what is shared is pretty much verbatim maybe some minor edits
Fluffy Hub@programming.devOPto
Rust@programming.dev•When you begin writing Rust like this...English
1·1 year agoYes a Global Allocator to be used with the GlobalAlloc trait

Ah, got it—let me clarify a bit.
Right now, I’m working with arrays and slicing them into smaller segments for indexing. Technically, I could rely on bit manipulation to generate much of this, but I’ve chosen to lean into Rust’s type system for that extra layer of expressive control.
In Rust, a slice is essentially a fat pointer: it includes both a memory address and a length. Because the slice type encapsulates both, I don’t need to manually track sizes or offsets. Plus, in debug builds, Rust automatically panics if I try to access an out-of-bounds index, which helps catch issues early. And I can use methods like
getorget_mutfor safe, optional access—either retrieving a value or returning None.Ultimately, Rust’s type system saves me from fiddling with raw bit arithmetic and length bookkeeping. It handles validation elegantly, letting me focus on logic instead of low-level guards.
PS: Although it isn’t finished just yet, I’m linking this
Nodeup with aBufandSlabstruct currently. If i remember when I’ve completed the design and I’m happy to freely distribute the code, I’ll make a paste bin and post it here for you. Always happy to help if I can :)