diff options
author | Craig Tiller <ctiller@google.com> | 2016-10-28 09:35:08 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-28 09:35:08 -0700 |
commit | e9ba66e821579ece80ab9a46798a7ecfcf8c35c6 (patch) | |
tree | a41e46454562d0b7eac0574a63a23e965ff87395 | |
parent | 1e1711845f60023e7d38d7935c4578495be1782a (diff) | |
parent | f405035002db148e6f3182d8b647e94e2686f337 (diff) |
Merge pull request #8555 from ctiller/buffer_pools_for_realsies
More Windows Fixes
-rw-r--r-- | test/core/end2end/tests/resource_quota_server.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/test/core/end2end/tests/resource_quota_server.c b/test/core/end2end/tests/resource_quota_server.c index 76374d16a5..fbd4986dfb 100644 --- a/test/core/end2end/tests/resource_quota_server.c +++ b/test/core/end2end/tests/resource_quota_server.c @@ -99,12 +99,16 @@ static void end_test(grpc_end2end_test_fixture *f) { static gpr_slice generate_random_slice() { size_t i; static const char chars[] = "abcdefghijklmnopqrstuvwxyz1234567890"; - char output[1024 * 1024]; - for (i = 0; i < GPR_ARRAY_SIZE(output) - 1; ++i) { + char *output; + const size_t output_size = 1024 * 1024; + output = gpr_malloc(output_size); + for (i = 0; i < output_size - 1; ++i) { output[i] = chars[rand() % (int)(sizeof(chars) - 1)]; } - output[GPR_ARRAY_SIZE(output) - 1] = '\0'; - return gpr_slice_from_copied_string(output); + output[output_size - 1] = '\0'; + gpr_slice out = gpr_slice_from_copied_string(output); + gpr_free(output); + return out; } void resource_quota_server(grpc_end2end_test_config config) { |