资源简介
linux gcc软件包 linux系统中不可或缺的
代码片段和文件信息
/* alloca.c -- allocate automatically reclaimed memory
(Mostly) portable public-domain implementation -- D A Gwyn
This implementation of the PWB library alloca function
which is used to allocate space off the run-time stack so
that it is automatically reclaimed upon procedure exit
was inspired by discussions with J. Q. Johnson of Cornell.
J.Otto Tennant contributed the Cray support.
There are some preprocessor constants that can
be defined when compiling for your specific system for
improved efficiency; however the defaults should be okay.
The general concept of this implementation is to keep
track of all alloca-allocated blocks and reclaim any
that are found to be deeper in the stack than the current
invocation. This heuristic does not reclaim storage as
soon as it becomes invalid but it will do so eventually.
As a special case alloca(0) reclaims storage without
allocating any. It is a good idea to use alloca(0) in
your main control loop etc. to force garbage collection. */
#ifdef HAVE_CONFIG_H
#include
#endif
#ifdef HAVE_STRING_H
#include
#endif
#ifdef HAVE_STDLIB_H
#include
#endif
#ifdef emacs
#include “blockinput.h“
#endif
/* If compiling with GCC 2 this file‘s not needed. */
#if !defined (__GNUC__) || __GNUC__ < 2
/* If someone has defined alloca as a macro
there must be some other way alloca is supposed to work. */
#ifndef alloca
#ifdef emacs
#ifdef static
/* actually only want this if static is defined as ““
-- this is for usg in which emacs must undefine static
in order to make unexec workable
*/
#ifndef STACK_DIRECTION
you
lose
-- must know STACK_DIRECTION at compile-time
#endif /* STACK_DIRECTION undefined */
#endif /* static */
#endif /* emacs */
/* If your stack is a linked list of frames you have to
provide an “address metric“ ADDRESS_FUNCTION macro. */
#if defined (CRAY) && defined (CRAY_STACKSEG_END)
long i00afunc ();
#define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg))
#else
#define ADDRESS_FUNCTION(arg) &(arg)
#endif
#if __STDC__
typedef void *pointer;
#else
typedef char *pointer;
#endif
#ifndef NULL
#define NULL 0
#endif
/* Different portions of Emacs need to call different versions of
malloc. The Emacs executable needs alloca to call xmalloc because
ordinary malloc isn‘t protected from input signals. On the other
hand the utilities in lib-src need alloca to call malloc; some of
them are very simple and don‘t have an xmalloc routine.
Non-Emacs programs expect this to call use xmalloc.
Callers below should use malloc. */
#ifndef emacs
#define malloc xmalloc
#endif
extern pointer malloc ();
/* Define STACK_DIRECTION if you know the direction of stack
growth for your system; otherwise it will be automatically
deduced at run-time.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_
相关资源
- 剖析Linux系统下基于NUMA构建的服务
- linux SPI设备注册和驱动小结
- 周立功PCI CAN卡LINUX驱动ubuntu16.04内核
- 实现Windows与Linux两系统间自由切换
- 在双引导Linux系统上实现OS自动切换
- 如何删除Linux系统后找回Windows的启动
- Linux命令详解,循序渐进Linux
- Linux系统文件命令精通指南(下)
- Linux系统命令及Shell脚本实践指南
- RK3308 LINUX开发者指南(1).pdf
- S3C4510 开发板中uCLinux系统开发
- 嵌入式操作系统的解析
- Linux点阵字库和字库生成器.rar
- Linux-UNIX系统编程手册上、下册中文版
- 基于ARM的电子相册源码含动态库可运
- PSFTP.EXE 工具
- 如何实现Linux与windows文件互传
- Linux内核函数Start_kernel()的功能
- 一只老鸟的嵌入式ARM学习心得
- cximage的linux版本源码
- yaf-2.1.17.tgz
- IBM eServer xSeries 445 EXP400在Linux下的双
- 如何在本地无光驱软驱时通过PXE远程
- Linux操作系统下配置无密码的RSH访问
- 如何利用mdadm在Linux中配置RAID
- db2 v9.5 linux 许可证
- linux telnet服务安装包
- SUSE Linux Enterprise——助力曙光高
- 运行LINUX的中高端HP INTEGRITY服务器
- lsoflist open files命令
评论
共有 条评论