[libuv] Is it safe to use static or pre-allocated buffer when receiving data form a single loop?

2016-09-21 Thread Sunny
Hi everyone, I'm working on a simple network application and I'm new to the libuv, so I have this noob question to ask If I have an application which use only one loop, with many tcp/udp handler registered on it, is it safe to use static buffer in uv_alloc_cb like this? static char

[libuv] Is it safe for use a static or pre-allocated buffer when receiving data from loop

2016-09-21 Thread Sunny
Hi, everyone, I'm working on a simple network application and I'm new to libuv, so I have a question about the buffer allocation. If I have only one event loop in application, and I registered many tcp and udp handlers on the event loop, does it safe for use the following code as uv_alloc_cb?