3 ms·
Yes, in that normal closures being stack or heap allocated is an implementation detail; at least in CL. SBCL can stack allocate some closures if DYNAMIC-EXTENT
by BoingBoomTschak 10mo ago
Yes, in that normal closures being stack or heap allocated is an implementation detail; at least in CL. SBCL can stack allocate some closures if DYNAMIC-EXTENT is used: https://www.sbcl.org/manual/#Stack-allocation-1 https://www.sbcl.org/manual/#Stack-allocation-1
- deleted 10mo ago[deleted]
- pfdietz 10mo agoOr I believe if it can determine the closure has dynamic extent, for example if it's passed to a standard function for which it knows the closure will not escape.
- BoingBoomTschak 10mo agoIndeed, it's newish (from this summer https://github.com/sbcl/sbcl/releases/tag/sbcl-2.5.6 https://github.com/sbcl/sbcl/releases/tag/sbcl-2.5.6) and mainly thanks to C. Zhang's work. https://github.com/sbcl/sbcl/commit/021414445224e692ebb9c48c0505b0c1ffc10669 https://github.com/sbcl/sbcl/commit/021414445224e692ebb9c48c... https://github.com/sbcl/sbcl/commit/2c56c5901df1a5ea98ae19e966ec9315be3ebfb9 https://github.com/sbcl/sbcl/commit/2c56c5901df1a5ea98ae19e9...