[ProgClub list] Memory management in C

Asher Glynn asher.glynn at gmail.com
Sat Oct 1 20:00:20 AEST 2011

> Man page seems to be discouraging it, which is fair enough if its got
>> variant behaviour depending on the underlying architecture.
> Well the main reason for avoiding stack allocation is that it's so easy to
> run out of space on the stack.

Trade off on "automatic" garbage collection - there's a cost somewhere...

> I have to say, the function sounds like a steaming pile of crap!
> "The inlined code often consists of a single instruction adjusting the
> stack pointer, and does not check for stack overflow."
> I'm learning more about C, and the more I learn the more I'm convinced that
> C programmers just like making life difficult for themselves. There really
> isn't anything that great about C. It's full of bugs and hacks, and it is
> really showing its age. I can't imagine recommending the language to anyone.

Never going to argue with that, unless they are doing Unix development. I
bite though - what _would_ you recommend?

> Although, there is something mystical (and powerful) about it.

I think its aged remarkably well - what hasn't aged well is more the bits at
the edge (APIs etc) and some of the assumptions about how it'd be used. It
dates back to a time where the competition was assembler, not high level
languages. Its also interesting to note the amount of C that isn't actually
in C as such - the compiler directives.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.progclub.org/pipermail/list/attachments/20111001/df75a9cf/attachment.html>

More information about the list mailing list