🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #5319

Re: alloca() for Turbo C

#5319
From: Eric Vaitl
Date: Wed, 20 Mar 1991 05:49
24 lines
1420 bytes
>Does anyone know where I can get a PD version of alloca() for Turbo C?
>I'm trying to compile some GNU stuff which uses it.
>
>Thanks!
>--
>Jeff Chadbourne
>chadbourne@nms.gdc.portal.com


I got this from one of the versions of Bison floating around:

/***********************************************************************\
| The following gives the definition of a macro (alloca) that allocates |
| space like malloc EXCEPT that it is allocated from the stack and does |
| not have to be freed.  The allocated space will automatically disap-  |
| pear when the function that allocated the space exits.                |
\***********************************************************************/
#if !defined(alloca)
#if defined(__COMPACT__) || defined(__LARGE__) || defined(__HUGE__)
#define alloca(i) (_SP-=((i+1)&0xFFFE),(void *)(((unsigned long)_SS<<16)|_SP))
#else
#define alloca(i) (_SP-=((i+1)&0xFFFE),(void *)_SP)
#endif
#endif
Technical Details
Message-ID: <1991Mar20.054928.24101@ucselx.sdsu.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!uwm.edu!bionet!ucselx!vaitl
References: <200@esun49.nms.gdc.portal.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!uwm.edu!bionet!ucselx!vaitl
From: vaitl@ucselx.sdsu.edu (Eric Vaitl)
Newsgroups: comp.os.msdos.programmer
Subject: Re: alloca() for Turbo C
Message-ID: <1991Mar20.054928.24101@ucselx.sdsu.edu>
Date: 20 Mar 91 05:49:28 GMT
References: <200@esun49.nms.gdc.portal.com>
Sender: vaitl@ucselx (Eric Vaitl)
Organization: San Diego State University Computing Services
Lines: 24