mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 01:55:51 +02:00
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
16 lines
334 B
C
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 */
|