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
Currently, postgres_ffi::xlog_utils and zenith_utils::lsn both use usize for many of the integer arguments, even though the functions all converts it to something else later (u32 or u64). I'm sure there's other modules that do this as well, but I'm just highlighting these because I was working with them.
If possible, I think we should be explicit about the size of the integers we're expecting there, because interfacing with these tends to still require casting to a usize and back, because we read and store the data as u32s or u64s. There isn't really a good rust analog for C's "I'll take an integer of any size using #define" -- or at least not one that doesn't heavily add to code verbosity and compile times.
I opened this issue instead of just making the PR because I wanted to gauge people's thoughts/opinions on this.
The text was updated successfully, but these errors were encountered:
Currently,
postgres_ffi::xlog_utils
andzenith_utils::lsn
both useusize
for many of the integer arguments, even though the functions all converts it to something else later (u32
oru64
). I'm sure there's other modules that do this as well, but I'm just highlighting these because I was working with them.If possible, I think we should be explicit about the size of the integers we're expecting there, because interfacing with these tends to still require casting to a
usize
and back, because we read and store the data asu32
s oru64
s. There isn't really a good rust analog for C's "I'll take an integer of any size using #define" -- or at least not one that doesn't heavily add to code verbosity and compile times.I opened this issue instead of just making the PR because I wanted to gauge people's thoughts/opinions on this.
The text was updated successfully, but these errors were encountered: