Skip to content

Commit

Permalink
make naming consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriyMusatkin committed Oct 20, 2023
1 parent a45601f commit a430c99
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions source/posix/system_resource_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

#include <sys/resource.h>

int aws_memory_usage_for_current_process(struct aws_memory_usage *mu) {
AWS_PRECONDITION(mu);
int aws_memory_usage_for_current_process(struct aws_memory_usage *memory_usage) {
AWS_PRECONDITION(memory_usage);

struct rusage usage;

Expand All @@ -22,10 +22,10 @@ int aws_memory_usage_for_current_process(struct aws_memory_usage *mu) {
* around MacOS 10.6.
* Make it back to KB. Result might be slightly off due to rounding.
*/
mu->maxrss = usage.ru_maxrss / 1024;
memory_usage->maxrss = usage.ru_maxrss / 1024;
#else
mu->maxrss = usage.ru_maxrss;
memory_usage->maxrss = usage.ru_maxrss;
#endif
mu->page_faults = usage.ru_majflt;
memory_usage->page_faults = usage.ru_majflt;
return AWS_OP_SUCCESS;
}
8 changes: 4 additions & 4 deletions source/windows/system_resource_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

#include <psapi.h>

int aws_memory_usage_for_current_process(struct aws_memory_usage *mu) {
AWS_PRECONDITION(mu);
int aws_memory_usage_for_current_process(struct aws_memory_usage *memory_usage) {
AWS_PRECONDITION(memory_usage);

HANDLE hProcess = GetCurrentProcess();

Expand All @@ -23,8 +23,8 @@ int aws_memory_usage_for_current_process(struct aws_memory_usage *mu) {
return aws_raise_error(AWS_ERROR_SYS_CALL_FAILURE);
}

mu->maxrss = pmc.PeakWorkingSetSize;
mu->page_faults = pmc.PageFaultCount;
memory_usage->maxrss = pmc.PeakWorkingSetSize;
memory_usage->page_faults = pmc.PageFaultCount;

return AWS_OP_SUCCESS;
}

0 comments on commit a430c99

Please sign in to comment.