Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the name of the problem that relates to optimizing closures on a stack-based system?

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?

like image 380
Matt Ball Avatar asked Dec 06 '09 22:12

Matt Ball


2 Answers

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

like image 111
Darius Bacon Avatar answered Sep 28 '22 00:09

Darius Bacon


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.

like image 39
seh Avatar answered Sep 28 '22 02:09

seh