views:

81

answers:

3

I remember hearing about a general optimization problem that relates to function closures, stating that in general it's difficult to optimize the creation of a closure using only stack-based memory management. Do any of you remember the name of this optimization problem, possibly with an example or link to relevant page?

+4  A: 

It sounds like you're thinking of the upward funarg problem.

Darius Bacon
That was it! I was looking at the Wikipedia's article on Closures, but didn't see a good link to the funarg article. It's there, but is given without comment. I'll go fix that...
Matt Ball
+2  A: 

Are you thinking of escape analysis?

Amber
+3  A: 

Perhaps you're thinking of escape analysis.

It concerns the distinction between what the Lisp community calls its two kinds of extent: dynamic extent and indefinite extent. Objects of the former can be stack-allocated, while the latter cannot, as their lifetime likely exceeds the scope of their allocation.

seh
Definitely an interesting problem as well!
Matt Ball