- Notifications
You must be signed in to change notification settings - Fork16
Remove erroneous cast to size_t in BID_HASH_FUNC#10
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
@@ -86,7 +86,7 @@ typedef PtrackMapHdr * PtrackMap; | |||
/* Block address 'bid' to hash. To get slot position in map should be divided | |||
* with '% PtrackContentNblocks' */ | |||
#define BID_HASH_FUNC(bid) \ | |||
(size_t)(DatumGetUInt64(hash_any_extended((unsigned char *)&bid, sizeof(bid), 0))) | |||
(DatumGetUInt64(hash_any_extended((unsigned char *)&bid, sizeof(bid), 0))) |
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.
Yeah, thissize_t
seems to be not correct, since it is 32 bit wide on 32 bit systems, which is not what we want here. However, next we assign this value tohash
variable, which again has asize_t
type, so this change alone does not has much sense, doesn't it? Probably we should change all appearances ofsize_t
used for hash map reference touint64
for portability?
funny-falconMay 24, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
Yep, I recognizehash
variable as well. I've just push-forced branch.
It were mistakenly remain after change of BID_HASH_FUNC meaning
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.
LGTM now
It were mistakenly remain after change of BID_HASH_FUNC meaning