Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Stack Overflow = Garbage Collection

Name: Anonymous 2009-11-11 12:45

If my functions only use a few variables and never return, then I never need anything but stack memory, and overflow is simply garbage collection. Is this possible in C?

Name: Anonymous 2009-11-11 12:51

If you overflow your stack you're fucked. Maybe you meant function return instead?

Name: Anonymous 2009-11-11 12:51

I don't think you know what anything of what you've said actually means.

Name: Anonymous 2009-11-11 12:53

>>2
I'm only fucked if I still need to access the old values. But the point is that I don't... a function uses a few, then goes to the next function, which uses a few, etc. By the time the old values would be pushed out, I don't need them anymore.

Name: Anonymous 2009-11-11 12:55

>>4
If you overflow your stack the OS will kill your program dead.

Name: Anonymous 2009-11-11 12:55

>>1
It's almost word salad.

Name: Anonymous 2009-11-11 13:03

I think OP means that his stack pointer monadicaly overflows.

Name: Anonymous 2009-11-11 13:07

overflow my anus

Name: sage 2009-11-11 13:09

Is this you again, Troël Spolsky?

Name: Anonymous 2009-11-11 13:14

Technically, a stack overflow will trigger an exception which can be handled, but this is not possible in ANSI C, however most C compilers(like MSVC) provide extensions for exception handling.

Name: Anonymous 2009-11-11 13:46

If you never return, what are you doing making function calls in the first place?

Maybe a giant nest of switches? Or do you need recursion? gotos? COMPUTED GOTOS? strfry()?

Name: HMA MEME FAN 2009-11-11 13:58

>>8
You really should stop doing this, it makes my meme look bad. :(

Name: Anonymous 2009-11-11 14:14

>>11
setjmp/longjmp, like god intended.

Name: Anonymous 2009-11-11 15:16

>>10
Thanks.

Name: Anonymous 2009-11-11 15:30

>>12
aha i knew it was forced

Name: Anonymous 2009-11-11 15:32

Read http://home.pipeline.com/~hbaker1/CheneyMTA.html and the Chicken Scheme source.

Name: Anonymous 2009-11-11 17:16

>>5
Not if you set up a SIGSEGV handler and a separate signal stack.

Name: Anonymous 2009-11-11 18:16

>>16
Ahh, I swear I had read about something similar before. Very cool.

Name: HMA FAN 2009-11-11 21:38

>>12
I agree. However, when posting under my username, refrain from using smilies, please.

Name: Anonymous 2009-11-12 10:44

>>1
If you were only to use stack memory to store variables, then "garbage collection" would be your functions returning.

Name: Anonymous 2010-11-26 0:36


Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List