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
While working on file system drivers for a custom operating system, I'm using buffers, which basically consist of multiple entries. Each entry contains a slice DST, but it's not possible to store them as slice itself, which is why I need to split them up.
but requires some boilerplate. (and also a align method, which aligns the pointer)
The compiler will probably figure out the alignment at compile-time and optimize out the alignment check. But it's better to use the already known layout information.
The text was updated successfully, but these errors were encountered:
In my example, Entry has to be aligned. I'm getting the end of the name, and align it to the next 8-byte, to read the next Entry. (The align method just takes the ptr, and aligns it, and corrects the length)
Had to use a custom method, as align_to doesn't work on slice DSTs.
While working on file system drivers for a custom operating system, I'm using buffers, which basically consist of multiple entries. Each entry contains a slice DST, but it's not possible to store them as slice itself, which is why I need to split them up.
One entry might look like:
where the first entry's name has the full length of the buffer.
And are split up by
but requires some boilerplate. (and also a align method, which aligns the pointer)
The compiler will probably figure out the alignment at compile-time and optimize out the alignment check. But it's better to use the already known layout information.
The text was updated successfully, but these errors were encountered: