WITH-ALIEN binds *alien-stack* even when not necessary
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Low
|
Unassigned |
Bug Description
A foreign function call defined like this:
(defun microseconds-now (now)
(declare (type system-area-pointer now))
(with-alien ((microseconds-now (function void (* int)) :extern "microseconds_
generates code that does an unnecessary binding of *alien-stack*, which is a lot of overhead for a foreign function call, especially since nothing is actually allocated on the alien stack. Changing it to avoid the WITH-ALIEN (using extern-alien instead) solves the problem, so this is not really a big deal, though I think this would occur if all alien variables were allocated on the heap as well.
Perhaps the binding could be conditionalized on whether WITH-ALIEN actually allocates anything on the stack.
Tested version: 1.0.17.39
Platform: Linux x86-64
Changed in sbcl: | |
importance: | Undecided → Low |
status: | New → Triaged |
tags: | added: alien optimization |
Changed in sbcl: | |
status: | Fix Committed → Fix Released |
In 639b29cbdf3e9ff 7d0897d299e7feb 1889f09fd5