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/ _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel