memcpy with a small fixed size is optimized by all contemporary compilers
to a few assembly instructions, but contrary to the pointer casting it
lets the compiler do the right thing.
Details
Details
ctest
Diff Detail
Diff Detail
- Repository
- R293 Baloo
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Comment Actions
Alternative: return (quint64(devId) << 32) | inode;
Not endian-dependent, like the memcpy solution. Make sure the other side is adapted to match.
Comment Actions
Thats the problem here - the "other side" is an ondisk DB ...
But removing devId from the ID and just keeping inode is on the todo list, we are asking for trouble here anyway in case of 64bit inodes.