diff options
author | Masood Malekghassemi <atash@google.com> | 2016-10-31 17:20:15 -0700 |
---|---|---|
committer | Masood Malekghassemi <atash@google.com> | 2016-10-31 17:27:44 -0700 |
commit | 5a4005772d4d5025c6ffc704dcfec7fcc6cafe97 (patch) | |
tree | 999ebea836234e2a2a515f30cb1aa000ef5498ff | |
parent | 0df7d349b7ceb510e71481ff6ea707be2db0160a (diff) |
Don't use the stack so much
Because internally we like to keep our thread stacks tiny.
-rw-r--r-- | test/core/end2end/tests/resource_quota_server.c | 39 |
1 files changed, 28 insertions, 11 deletions
diff --git a/test/core/end2end/tests/resource_quota_server.c b/test/core/end2end/tests/resource_quota_server.c index fbd4986dfb..47c5ed6abb 100644 --- a/test/core/end2end/tests/resource_quota_server.c +++ b/test/core/end2end/tests/resource_quota_server.c @@ -137,17 +137,22 @@ void resource_quota_server(grpc_end2end_test_config config) { * will be verified on completion. */ gpr_slice request_payload_slice = generate_random_slice(); - grpc_call *client_calls[NUM_CALLS]; - grpc_call *server_calls[NUM_CALLS]; - grpc_metadata_array initial_metadata_recv[NUM_CALLS]; - grpc_metadata_array trailing_metadata_recv[NUM_CALLS]; - grpc_metadata_array request_metadata_recv[NUM_CALLS]; - grpc_call_details call_details[NUM_CALLS]; - grpc_status_code status[NUM_CALLS]; - char *details[NUM_CALLS]; - size_t details_capacity[NUM_CALLS]; - grpc_byte_buffer *request_payload_recv[NUM_CALLS]; - int was_cancelled[NUM_CALLS]; + grpc_call **client_calls = malloc(sizeof(grpc_call *) * NUM_CALLS); + grpc_call **server_calls = malloc(sizeof(grpc_call *) * NUM_CALLS); + grpc_metadata_array *initial_metadata_recv = + malloc(sizeof(grpc_metadata_array) * NUM_CALLS); + grpc_metadata_array *trailing_metadata_recv = + malloc(sizeof(grpc_metadata_array) * NUM_CALLS); + grpc_metadata_array *request_metadata_recv = + malloc(sizeof(grpc_metadata_array) * NUM_CALLS); + grpc_call_details *call_details = + malloc(sizeof(grpc_call_details) * NUM_CALLS); + grpc_status_code *status = malloc(sizeof(grpc_status_code) * NUM_CALLS); + char **details = malloc(sizeof(char *) * NUM_CALLS); + size_t *details_capacity = malloc(sizeof(size_t) * NUM_CALLS); + grpc_byte_buffer **request_payload_recv = + malloc(sizeof(grpc_byte_buffer *) * NUM_CALLS); + int *was_cancelled = malloc(sizeof(int) * NUM_CALLS); grpc_call_error error; int pending_client_calls = 0; int pending_server_start_calls = 0; @@ -356,6 +361,18 @@ void resource_quota_server(grpc_end2end_test_config config) { gpr_slice_unref(request_payload_slice); grpc_resource_quota_unref(resource_quota); + free(client_calls); + free(server_calls); + free(initial_metadata_recv); + free(trailing_metadata_recv); + free(request_metadata_recv); + free(call_details); + free(status); + free(details); + free(details_capacity); + free(request_payload_recv); + free(was_cancelled); + end_test(&f); config.tear_down_data(&f); } |