Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #65425

Re: lalloc() -- local stack allocation

From "Chris M. Thomasson" <nospam@nospam.nospam>
Newsgroups comp.lang.c
Subject Re: lalloc() -- local stack allocation
Date 2015-07-12 10:17 -0700
Organization Aioe.org NNTP Server
Message-ID <mnu7fa$v6f$1@speranza.aioe.org> (permalink)
References <e9abe69a-2532-44f3-be7b-aaa236783cfb@googlegroups.com>

Show all headers | View raw


> "Rick C. Hodgin"  wrote in message 
> news:e9abe69a-2532-44f3-be7b-aaa236783cfb@googlegroups.com...
> Does C define a type of lalloc() function for local / stack allocation?
> On x86 (which has an expand-down stack):

[...]

No. However, and FWIW, here is a "hack" at a region allocator I wrote a 
while
back that can be fed with a buffer on the stack:

https://groups.google.com/d/msg/comp.lang.C/7oaJFWKVCTw/sSWYU9BUS_QJ

http://pastebin.com/f37a23918

Unfortunately, it uses some non-portable trickery wrt alignment...

Yikes!

;^o


Also, VLA's might be of use to you but I believe they are optional. 

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

lalloc() -- local stack allocation "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-07-12 02:23 -0700
  Re: lalloc() -- local stack allocation Johannes Bauer <dfnsonfsduifb@gmx.de> - 2015-07-12 11:48 +0200
    Re: lalloc() -- local stack allocation Johannes Bauer <dfnsonfsduifb@gmx.de> - 2015-07-12 11:48 +0200
  Re: lalloc() -- local stack allocation Philipp Klaus Krause <pkk@spth.de> - 2015-07-12 13:33 +0200
  Re: lalloc() -- local stack allocation Robert Wessel <robertwessel2@yahoo.com> - 2015-07-12 06:54 -0500
  Re: lalloc() -- local stack allocation Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-07-12 06:17 -0700
    Re: lalloc() -- local stack allocation Johannes Bauer <dfnsonfsduifb@gmx.de> - 2015-07-12 16:47 +0200
      Re: lalloc() -- local stack allocation Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-07-12 11:12 -0700
      Re: lalloc() -- local stack allocation supercat@casperkitty.com - 2015-09-08 11:53 -0700
        Re: lalloc() -- local stack allocation "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-09-08 12:16 -0700
          Re: lalloc() -- local stack allocation supercat@casperkitty.com - 2015-09-08 15:46 -0700
            Re: lalloc() -- local stack allocation "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-09-08 16:12 -0700
        Re: lalloc() -- local stack allocation Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-09-08 20:32 +0100
        Re: lalloc() -- local stack allocation jadill33@gmail.com - 2015-09-08 13:25 -0700
  Re: lalloc() -- local stack allocation "Chris M. Thomasson" <nospam@nospam.nospam> - 2015-07-12 10:17 -0700
  Re: lalloc() -- local stack allocation gordonb.zziiu@burditt.org (Gordon Burditt) - 2015-07-27 22:41 -0500
    Re: lalloc() -- local stack allocation Keith Thompson <kst-u@mib.org> - 2015-07-28 08:35 -0700

csiph-web