Hacker News new | past | comments | ask | show | jobs | submit login

The libuv API is not amateur, is all about flexibility. The example usage however is not optimal, it is just confused.

The option to dynamically alloc uv_loop_t is not to avoid "accidental copies" or anysuch thing. Is there for when you need to dynamically create loop contexts.

Linux does exactly the same thing. But you wont see unecesary kmallocs of structs when static storage is enough. In such cases you will see the *_init functions used.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: