Skip to content

Commit

Permalink
allocate a buf before
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriyMusatkin committed Oct 27, 2023
1 parent 2e2a01b commit c956f11
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/system_resource_util_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,24 @@
* SPDX-License-Identifier: Apache-2.0.
*/

#include <aws/common/byte_buf.h>
#include <aws/common/system_resource_util.h>

#include <aws/testing/aws_test_harness.h>

static int s_test_memory_usage_maxrss(struct aws_allocator *allocator, void *ctx) {
(void)allocator;
(void)ctx;

struct aws_byte_buf temp;
aws_byte_buf_init(&temp, allocator, 8 * 1024 * 1024);

struct aws_memory_usage_stats mu;
ASSERT_SUCCESS(aws_init_memory_usage_for_current_process(&mu));

ASSERT_TRUE(mu.maxrss > 0);

aws_byte_buf_clean_up(&temp);

return 0;
}

Expand Down

0 comments on commit c956f11

Please sign in to comment.