-
Notifications
You must be signed in to change notification settings - Fork 1.9k
FreeBSD: avoid memory allocation in arc_prune_async #11927
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
Conversation
Signed-off-by: Mateusz Guzik <[email protected]>
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 have no objections about the idea, but have few about implementation.
int64_t nr_scan = (int64_t)arg; | ||
#else | ||
int64_t nr_scan = (int32_t)arg; | ||
#endif |
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 not intptr_t?
@@ -185,13 +188,14 @@ arc_prune_task(void *arg) | |||
void | |||
arc_prune_async(int64_t adjust) | |||
{ | |||
|
|||
int64_t *adjustptr; |
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'd make it void * or remove completely.
|
||
*adjustptr = adjust; | ||
adjustptr = (void *)adjust; |
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 think it would be better be brought to intptr_t first.
@mjguzik when you get a chance can you address the review feedback in this PR. |
@tonynguien let's go ahead and move forward with the updated version of this in PR #12049. |
Mateusz just today answered me in private email that he does not care which of the versions is committed. |
Signed-off-by: Mateusz Guzik [email protected]
Motivation and Context
Description
How Has This Been Tested?
Types of changes
Checklist:
Signed-off-by
.