1 Star 1 Fork 1

Linux OS/busybox

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
auto_string.c 435 Bytes
一键复制 编辑 原始数据 按行查看 历史
/* vi: set sw=4 ts=4: */
/*
* Utility routines.
*
* Copyright (C) 2015 Denys Vlasenko
*
* Licensed under GPLv2, see file LICENSE in this source tree.
*/
//kbuild:lib-y += auto_string.o
#include "libbb.h"
char* FAST_FUNC auto_string(char *str)
{
static char *saved[4];
static uint8_t cur_saved; /* = 0 */
free(saved[cur_saved]);
saved[cur_saved] = str;
cur_saved = (cur_saved + 1) & (ARRAY_SIZE(saved)-1);
return str;
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/linux-os/busybox.git
git@gitee.com:linux-os/busybox.git
linux-os
busybox
busybox
master

搜索帮助