while (free_later) {
struct io_conn *c = free_later;
free_later = c->finish_arg;
- free(c);
+ io_alloc.free(c);
}
}
}
conn->finish_arg = free_later;
free_later = conn;
} else
- free(conn);
+ io_alloc.free(conn);
}
#else
static void io_loop_enter(void)
}
static void free_conn(struct io_conn *conn)
{
- free(conn);
+ io_alloc.free(conn);
}
#endif
struct fd **newfds;
size_t num = max_fds ? max_fds * 2 : 8;
- newpollfds = realloc(pollfds, sizeof(*newpollfds) * num);
+ newpollfds = io_alloc.realloc(pollfds, sizeof(*newpollfds)*num);
if (!newpollfds)
return false;
pollfds = newpollfds;
- newfds = realloc(fds, sizeof(*newfds) * num);
+ newfds = io_alloc.realloc(fds, sizeof(*newfds) * num);
if (!newfds)
return false;
fds = newfds;
fds[n]->backend_info = n;
} else if (num_fds == 1) {
/* Free everything when no more fds. */
- free(pollfds);
- free(fds);
+ io_alloc.free(pollfds);
+ io_alloc.free(fds);
pollfds = NULL;
fds = NULL;
max_fds = 0;
}
if (timeout_active(conn))
backend_del_timeout(conn);
- free(conn->timeout);
+ io_alloc.free(conn->timeout);
if (conn->duplex) {
/* In case fds[] pointed to the other one. */
fds[conn->fd.backend_info] = &conn->duplex->fd;