Skip to content

Commit

Permalink
Prealloc 16 ipc slots in poll handle array. (dotnet#46981)
Browse files Browse the repository at this point in the history
  • Loading branch information
lateralusX committed Jan 14, 2021
1 parent 1f736c1 commit de5f1bd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/native/eventpipe/ds-ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ static ds_rt_port_array_t _ds_port_array = { 0 };
// allows us to track which connections have sent their ResumeRuntime commands
static DiagnosticsPort *_ds_current_port = NULL;

static const uint32_t _ds_default_poll_handle_array_size = 16;

static
inline
bool
Expand Down Expand Up @@ -339,7 +341,7 @@ ds_ipc_stream_factory_get_next_available_stream (ds_ipc_error_callback_func call

DS_RT_DECLARE_LOCAL_IPC_POLL_HANDLE_ARRAY (ipc_poll_handles);

ds_rt_ipc_poll_handle_array_init (&ipc_poll_handles);
ds_rt_ipc_poll_handle_array_init_capacity (&ipc_poll_handles, _ds_default_poll_handle_array_size);
ep_raise_error_if_nok (ds_rt_ipc_poll_handle_array_is_valid (&ipc_poll_handles));

while (!stream) {
Expand Down

0 comments on commit de5f1bd

Please sign in to comment.