-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GAIAPLAT-425] Change locator size to 32 bits #1380
Conversation
@@ -119,6 +119,9 @@ struct hash_node_t | |||
struct log_record_t | |||
{ | |||
gaia_locator_t locator; | |||
// Locators are now 4 bytes, so we need to add 4 bytes of padding to keep | |||
// total size at 16 bytes. | |||
uint32_t reserved; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't we place this padding at the end?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I'd shorten the comment to the essential: "We need 4 bytes of padding to maintain total size at 16 bytes".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't we place this padding at the end?
It's not essential, but I prefer to align the two offsets on an 8-byte boundary, in case I wanted to treat them atomically at some point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need 4 bytes of padding to maintain total size at 16 bytes
OK, I was referencing the locator size change itself, but I guess code comments shouldn't reference changes unless absolutely necessary. Updated comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer to align the two offsets on an 8-byte boundary, in case I wanted to treat them atomically at some point.
In that case, can you add a comment about this? Although frankly, why wouldn't you defer any fancy ordering until it's actually needed? If you'd even need something like this, you could always re-arrange the fields at that time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I left a couple of suggestions - I'd particularly want to have the assert added, to hard code the relationship between the gaia_handle_t
and gaia_locator_t
. I thought we already did this, but it looks like I was wrong.
This is a very old task that's been repeatedly deferred, but it's finally necessary for my current table scan index changes (I need to add a metadata word to the locator list node structure, which must be updated atomically with the locator-valued "next" pointer, so the whole thing must fit into 8 bytes). Because locators have always been de facto 32-bit-valued, there are no changes required other than updating type definitions.