33 if (!buf || len == 0) {
39#if defined(MSG_NOSIGNAL)
45 n = send(fd, buf, len, flags);
50 if ((
size_t)
n == len) {
91#if defined(MSG_NOSIGNAL)
95#ifdef CWIST_WASI_SOCKETS
167 if (seed == 0) seed = 0x9e3779b9;
202#if defined(CLOCK_MONOTONIC_COARSE)
Memory allocation wrappers backed by libttak.
void cwist_free(void *ptr)
Free memory obtained via cwist_alloc/cwist_strdup/etc.
void * cwist_alloc(size_t size)
Allocate zeroed memory tracked by libttak.
WASI target feature detection shared by all CWIST sources.
cwist_write_status_t cwist_http_send_speculative(int fd, const void *buf, size_t len, size_t *sent_out)
Attempt a single non-blocking speculative write of a buffer to a socket.
cwist_write_status_t cwist_http_sendmsg_speculative(int fd, struct iovec *iov, int iovcnt, int flags, size_t *total_sent)
Attempt a single non-blocking speculative sendmsg over an iovec array.
uint32_t cwist_sched_p2c_select_worker(const _Atomic uint32_t *worker_loads, uint32_t num_workers)
Select the less-loaded of two randomly sampled workers (power-of-two choices).
uint32_t cwist_fast_monotonic_sec(void)
Return a cheap monotonic timestamp in whole seconds.
Zero-latency speculative fast-path writer and P2C worker scheduler.