linux/tools/include/nolibc/alloca.h
Thomas Weißschuh 80e5de852e tools/nolibc: add alloca()
Add the wide-used alloca() function. As it is highly machine and
compiler dependent, just defer to the compiler builtin. This has
been available since GCC 4 and clang 3.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Willy Tarreau <w@1wt.eu>
Link: https://patch.msgid.link/20260409-nolibc-alloca-v1-1-ed02f68dfaf9@weissschuh.net
2026-04-27 09:00:50 +02:00

16 lines
334 B
C

/* SPDX-License-Identifier: LGPL-2.1 OR MIT */
/*
* alloca() for NOLIBC
* Copyright (C) 2026 Thomas Weißschuh <linux@weissschuh.net>
*/
/* make sure to include all global symbols */
#include "nolibc.h"
#ifndef _NOLIBC_ALLOCA_H
#define _NOLIBC_ALLOCA_H
#define alloca(size) __builtin_alloca(size)
#endif /* _NOLIBC_ALLOCA_H */