1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-17 14:14:49 +00:00

Work on kq

This commit is contained in:
Calvin Rose 2023-10-07 21:32:20 -05:00
parent 3905e92965
commit f1111c135b
2 changed files with 10 additions and 11 deletions

View File

@ -1659,7 +1659,7 @@ static void timestamp2timespec(struct timespec *t, JanetTimestamp ts) {
void janet_register_stream(JanetStream *stream) {
struct kevent kevs[2];
EV_SETx(&kevs[1], stream->handle, EVFILT_READ, EV_ADD | EV_ENABLE | EV_CLEAR | EV_EOF, 0, 0, stream);
EV_SETx(&kevs[0], stream->handle, EVFILT_READ, EV_ADD | EV_ENABLE | EV_CLEAR | EV_EOF, 0, 0, stream);
EV_SETx(&kevs[1], stream->handle, EVFILT_WRITE, EV_ADD | EV_ENABLE | EV_CLEAR | EV_EOF, 0, 0, stream);
int status;
do {

View File

@ -326,18 +326,17 @@ static void janet_deinit_block(JanetGCObject *mem) {
case JANET_MEMORY_TABLE:
janet_free(((JanetTable *) mem)->data);
break;
case JANET_MEMORY_FIBER:
{
JanetFiber *f = (JanetFiber *)mem;
case JANET_MEMORY_FIBER: {
JanetFiber *f = (JanetFiber *)mem;
#ifdef JANET_EV
if (f->ev_state && !(f->flags & JANET_FIBER_EV_FLAG_IN_FLIGHT)) {
janet_ev_dec_refcount();
janet_free(f->ev_state);
}
#endif
janet_free(f->data);
if (f->ev_state && !(f->flags & JANET_FIBER_EV_FLAG_IN_FLIGHT)) {
janet_ev_dec_refcount();
janet_free(f->ev_state);
}
break;
#endif
janet_free(f->data);
}
break;
case JANET_MEMORY_BUFFER:
janet_buffer_deinit((JanetBuffer *) mem);
break;