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


Groups > comp.lang.c > #24177

Re: Strange C developments

From Jens Gustedt <jens.gustedt@loria.fr>
Newsgroups comp.lang.c
Subject Re: Strange C developments
Date 2012-08-03 23:47 +0200
Organization A noiseless patient Spider
Message-ID <501C4705.4080707@loria.fr> (permalink)
References <juchoa$974$1@speranza.aioe.org> <a89497c5-d2a0-47d7-82e5-fdb9be6a0d3e@m10g2000vbn.googlegroups.com> <796fadf8-6402-4a73-b110-f4e750ca1d79@8g2000vbx.googlegroups.com> <501AD3CC.7030006@loria.fr> <5fb30b1d-a102-4f0c-9446-af85d3b6c2ed@k13g2000yqk.googlegroups.com>

Show all headers | View raw


Am 03.08.2012 13:13, schrieb tom st denis:
> On Aug 2, 3:23 pm, Jens Gustedt <jens.gust...@loria.fr> wrote:
>> Why would you need such a "heap" marker syntactically?
>>
>> For your first example for the pointer (syntactically) I would just do
>>
>> int foo[1];
>>
>> An implementation could just decide to allocate "auto" arrays on the
>> heap, and free everything at the end of the liftime of the variable. You
>> don't have to add a jota to the syntax of C for that.
>>
>> The downside of such a "heap" approach for array allocation is that the
>> implementation of setjmp/longjmp would be come a bit more complicated.
>> You can't just re-adjust the stack pointer but you'd have to re-invent a
>> mechanism that "free"s all the allocated arrays on the way down, once
>> you jump to a different function stack. Isn't completely trivial.
> 
> Are there real people who use setjmp()/etc in everyday code?  I've
> never once used them despite all the oddball places my code has been
> found.

youp, I do

But really don't think of every day's programmer for that, but e.g
people that implement C++'s try/catch mechanism or other such stuff
for higher languages in C.

Said otherwise, deleting setjmp/longjmp from the language is certainly
not an option. It is a core feature.

> And while the compiler could automagically decide to take from the
> heap for auto variables it would be nice for that to be more manual.

perhaps

I was trying to think on a more realistic line. If you'd want such a
feature, there is nothing essential that would hinder you to implement
it first for auto variables without letting a choice to the
programmer. This can be done without extending the language. It would
have advantages (namely avoid stackoverflow, namely for VLA) and
downsides (a bit of performance loss).

If then you have a system that implements this, runs smoothly without
a bug for some time on a large variety of systems and code, you may
even propose the extension to allow to specify that explicitly, why
not.

Jens

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


Thread

Strange C developments Jase Schick <nospam@nospam.com> - 2012-07-20 21:14 +0000
  Re: Strange C developments Les Cargill <lcargill99@comcast.com> - 2012-07-20 18:03 -0500
  Re: Strange C developments "christian.bau" <christian.bau@cbau.wanadoo.co.uk> - 2012-07-20 16:03 -0700
    Re: Strange C developments Tim Rentsch <txr@alumni.caltech.edu> - 2012-07-21 15:11 -0700
    Re: Strange C developments tom st denis <tom@iahu.ca> - 2012-08-02 06:08 -0700
      Re: Strange C developments Jens Gustedt <jens.gustedt@loria.fr> - 2012-08-02 21:23 +0200
        Re: Strange C developments tom st denis <tom@iahu.ca> - 2012-08-03 04:13 -0700
          Re: Strange C developments Noob <root@127.0.0.1> - 2012-08-03 13:19 +0200
          Re: Strange C developments Anders Wegge Keller <wegge@wegge.dk> - 2012-08-03 13:31 +0200
          Re: Strange C developments Jens Gustedt <jens.gustedt@loria.fr> - 2012-08-03 23:47 +0200
      Re: Strange C developments gwowen <gwowen@gmail.com> - 2012-08-03 02:20 -0700
  Re: Strange C developments Rui Maciel <rui.maciel@gmail.com> - 2012-07-21 01:25 +0100
  Re: Strange C developments BGB <cr88192@hotmail.com> - 2012-07-20 19:38 -0500
  Re: Strange C developments Nobody <nobody@nowhere.com> - 2012-07-21 10:32 +0100
    Re: Strange C developments BGB <cr88192@hotmail.com> - 2012-07-21 09:31 -0500
      Re: Strange C developments Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-07-21 17:38 +0100
        Re: Strange C developments BGB <cr88192@hotmail.com> - 2012-07-21 12:58 -0500
        Re: Strange C developments Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-07-21 11:42 -0700
          Re: Strange C developments Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-07-21 20:13 +0100
            Re: Strange C developments Nobody <nobody@nowhere.com> - 2012-07-21 20:48 +0100
              Re: Strange C developments Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-07-21 23:32 +0100
  Re: Strange C developments jacob navia <jacob@spamsink.net> - 2012-07-21 11:43 +0200
    Re: Strange C developments Quentin Pope <qp19433@hotmail.NOSPAM.com> - 2012-07-21 10:23 +0000
      Re: Strange C developments jacob navia <jacob@spamsink.net> - 2012-07-21 13:01 +0200
        Re: Strange C developments gordonb.y4pdz@burditt.org (Gordon Burditt) - 2012-07-21 08:57 -0500
          Re: Strange C developments BGB <cr88192@hotmail.com> - 2012-07-21 10:40 -0500
          Re: Strange C developments jacob navia <jacob@spamsink.net> - 2012-07-21 19:03 +0200
            Re: Strange C developments gordonb.5rhpu@burditt.org (Gordon Burditt) - 2012-07-22 02:08 -0500
              Re: Strange C developments jacob navia <jacob@spamsink.net> - 2012-07-22 12:32 +0200
                Re: Strange C developments BGB <cr88192@hotmail.com> - 2012-07-22 08:26 -0500
            Re: Strange C developments Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-07-24 01:23 -0700
              Re: Strange C developments Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-07-24 05:36 -0700
                Re: Strange C developments Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-07-30 02:04 -0700
              Re: Strange C developments BGB <cr88192@hotmail.com> - 2012-07-24 09:55 -0500
                Re: Strange C developments 88888 Dihedral <dihedral88888@googlemail.com> - 2012-08-02 06:44 -0700
                Re: Strange C developments BGB <cr88192@hotmail.com> - 2012-08-03 08:48 -0500
          Re: Strange C developments jacob navia <jacob@spamsink.net> - 2012-07-21 19:06 +0200
            Re: Strange C developments gordonb.ibds9@burditt.org (Gordon Burditt) - 2012-07-22 02:28 -0500
              Re: Strange C developments jacob navia <jacob@spamsink.net> - 2012-07-22 12:30 +0200
              Re: Strange C developments Philip Lantz <prl@canterey.us> - 2012-07-24 00:58 -0700
        Re: Strange C developments Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-07-24 01:13 -0700
      Re: Strange C developments Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-07-21 05:44 -0700
        Re: Strange C developments Tim Rentsch <txr@alumni.caltech.edu> - 2012-07-21 15:31 -0700
          Re: Strange C developments Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-07-21 16:59 -0700
            Re: Strange C developments Tim Rentsch <txr@alumni.caltech.edu> - 2012-07-21 23:46 -0700
              Re: Strange C developments "io_x" <a@b.c.invalid> - 2012-07-22 10:37 +0200
                Re: Strange C developments Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-07-22 03:28 -0700
                Re: Strange C developments BGB <cr88192@hotmail.com> - 2012-07-22 09:05 -0500
                Re: Strange C developments Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-07-24 02:10 -0700
                Re: Strange C developments "io_x" <a@b.c.invalid> - 2012-07-27 20:47 +0200
                Re: Strange C developments Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-07-30 02:09 -0700
                Re: Strange C developments "BartC" <bc@freeuk.com> - 2012-07-30 13:05 +0100
                Re: Strange C developments BGB <cr88192@hotmail.com> - 2012-08-03 10:45 -0500
                Re: Strange C developments "io_x" <a@b.c.invalid> - 2012-07-30 16:52 +0200
                Re: Strange C developments "io_x" <a@b.c.invalid> - 2012-07-30 18:26 +0200
                Re: Strange C developments Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-08-03 12:12 -0700
                Re: Strange C developments "BartC" <bc@freeuk.com> - 2012-08-04 12:18 +0100
                Re: Strange C developments Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2012-08-10 09:50 +0300
                Re: Strange C developments Tim Rentsch <txr@alumni.caltech.edu> - 2012-09-07 11:19 -0700
                Re: Strange C developments "io_x" <a@b.c.invalid> - 2012-09-09 12:06 +0200
                Re: Strange C developments Kaz Kylheku <kaz@kylheku.com> - 2012-09-09 05:25 +0000
          Re: Strange C developments Melzzzzz <mel@zzzzz.com> - 2012-07-22 02:48 +0200
          Re: Strange C developments William Ahern <william@wilbur.25thandClement.com> - 2012-07-21 21:45 -0700
            Re: Strange C developments Tim Rentsch <txr@alumni.caltech.edu> - 2012-07-22 02:40 -0700
              Re: Strange C developments BGB <cr88192@hotmail.com> - 2012-07-22 10:38 -0500
          Re: Strange C developments William Ahern <william@wilbur.25thandClement.com> - 2012-07-21 22:38 -0700
            Re: Strange C developments jacob navia <jacob@spamsink.net> - 2012-07-22 08:43 +0200
            Re: Strange C developments "BartC" <bc@freeuk.com> - 2012-07-22 11:24 +0100
              Re: Strange C developments BGB <cr88192@hotmail.com> - 2012-08-03 09:09 -0500
                Re: Strange C developments BGB <cr88192@hotmail.com> - 2012-08-03 16:54 -0500
          Re: Strange C developments Tim Rentsch <txr@alumni.caltech.edu> - 2012-07-21 23:16 -0700
            Re: Strange C developments Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2012-07-22 17:50 +0300
              Re: Strange C developments BGB <cr88192@hotmail.com> - 2012-07-22 11:27 -0500
                Re: Strange C developments Ike Naar <ike@iceland.freeshell.org> - 2012-07-22 20:55 +0000
                Re: Strange C developments Philip Lantz <prl@canterey.us> - 2012-07-24 00:56 -0700
                Re: Strange C developments Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-07-24 01:57 -0700
              Re: Strange C developments Tim Rentsch <txr@alumni.caltech.edu> - 2012-09-07 11:20 -0700
      Re: Strange C developments Tim Rentsch <txr@alumni.caltech.edu> - 2012-07-21 15:13 -0700
  Re: Strange C developments John Bode <jfbode1029@gmail.com> - 2012-07-23 14:59 -0700

csiph-web