diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-04-15 15:58:31 -0600 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-04-15 15:58:31 -0600 |
commit | db9a58f48c6eae16fbfcd89d59b09e123dbed54f (patch) | |
tree | 8e20dd9bc3ddf7b766714a57a9d33259c0b91165 /libhw_cr/host_net.c | |
parent | 03f29736acfcfaee6f263fd1461f96ccae3696da (diff) |
libmisc: Add alloc.h to help detect wrong alloc sizes
Lo and behold, there was a mistake in chan.c.
Diffstat (limited to 'libhw_cr/host_net.c')
-rw-r--r-- | libhw_cr/host_net.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libhw_cr/host_net.c b/libhw_cr/host_net.c index 6ed6e46..ba634a6 100644 --- a/libhw_cr/host_net.c +++ b/libhw_cr/host_net.c @@ -19,6 +19,7 @@ #include <signal.h> /* for siginfo_t, struct sigaction, enum sigval, sigaction(), SA_SIGINFO */ #include <libcr/coroutine.h> +#include <libmisc/alloc.h> #include <libmisc/assert.h> #include <libmisc/macro.h> #include <libobj/obj.h> @@ -283,7 +284,7 @@ static void *hostnet_pthread_writev(void *_args) { struct hostnet_pthread_writev_args *args = _args; size_t count = 0; - struct iovec *iov = alloca(sizeof(struct iovec)*args->iovcnt); + struct iovec *iov = stack_alloc(args->iovcnt, struct iovec); for (int i = 0; i < args->iovcnt; i++) { iov[i] = args->iov[i]; count += args->iov[i].iov_len; |