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 /lib9p/srv.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 'lib9p/srv.c')
-rw-r--r-- | lib9p/srv.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib9p/srv.c b/lib9p/srv.c index 5c50130..a681952 100644 --- a/lib9p/srv.c +++ b/lib9p/srv.c @@ -4,7 +4,6 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ -#include <alloca.h> #include <inttypes.h> /* for PRI* */ #include <limits.h> /* for SSIZE_MAX, not set by newlib */ #include <stddef.h> /* for size_t */ @@ -17,6 +16,7 @@ #include <libcr/coroutine.h> #include <libcr_ipc/chan.h> #include <libcr_ipc/mutex.h> +#include <libmisc/alloc.h> #include <libmisc/assert.h> #include <libmisc/endian.h> #include <libmisc/map.h> @@ -739,7 +739,7 @@ static void handle_Tversion(struct srv_req *ctx, if (map_len(&ctx->parent_sess->reqs)) { /* Flush all in-progress requests, and wait for them * to finish. */ - struct cr_select_arg *list = alloca(sizeof(struct cr_select_arg) * map_len(&ctx->parent_sess->reqs)); + struct cr_select_arg *list = stack_alloc(map_len(&ctx->parent_sess->reqs), struct cr_select_arg); while (map_len(&ctx->parent_sess->reqs)) { size_t i = 0; bool flushed; |