[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Adds dimension stencil command to correct with-dimension (issue 1295
From: |
dak |
Subject: |
Re: Adds dimension stencil command to correct with-dimension (issue 12957047) |
Date: |
Wed, 04 Sep 2013 19:00:23 +0000 |
On 2013/09/04 18:36:16, Keith wrote:
https://codereview.appspot.com/12957047/diff/88001/lily/stencil-integral.cc
File lily/stencil-integral.cc (right):
https://codereview.appspot.com/12957047/diff/88001/lily/stencil-integral.cc#newcode917
lily/stencil-integral.cc:917: }
My best guess for the cause of the extra memory, showing in the `make
check`
profile output, is this loop written as tail recursion:
stencil_traverser (PangoMatrix trans, SCM expr) {
[...]
else if (scm_car (expr) == ly_symbol2scm ("skyline-stencil")) {
SCM skyline_stencil = scm_cadr (expr);
return stencil_traverser (trans, skyline_stencil);
}
Maybe having 'skyline_stencil' as an automatic variable and also a
function
parameter, which would be optimized to a different automatic variable
'expr' in
the same function, confuses the reference counting in Guile's
garbage-collection.
No, GUILE just scans the stack. Variable names are not relevant. Since
we are doing our statistics without optimisations, the "tail recursion"
will actually be a full recursion. However, by the time the statistics
are done, the stack frame is no longer there. So this should not make a
difference.
https://codereview.appspot.com/12957047/