void *rwtask(param_t v) {
...
a = v->int_ptr;
...
free(a);
It seems architecturally unwise to have a callback responsible for freeing its parameters. At the very least this fossilizes dependency on the stdlib heap.As for using the stdlib heap rather than some other thing: sure. But the routine allocating the buffer in this case used malloc to allocate it, and therefore freeing it with free seems at least not the worst option. If you want to do some other thing, you should do that instead.
Though I would prefer to have something not based on coroutines.
mgaunard•1mo ago
I guess because it's not possible to abstract away as much.
immibis•1mo ago
pengaru•1mo ago
https://github.com/libuv/libuv/issues/1947
manwe150•1mo ago
Aside: the wepoll mentioned in this repo is a standalone project extracted libuv, for projects that only desire to support Berkeley sockets and don’t care about other events sources (processes or pipes)
cryptonector•1mo ago
immibis•1mo ago
cryptonector•1mo ago
"do a read and wait for it" is synchronous I/O.
foobarian•1mo ago
> c-events provides function wrappers to some Linux like functionality, exp. mkfifo for Windows.