lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Avoid Scheme-computed Skyline_pair values to get collected before use (i


From: k-ohara5a5a
Subject: Avoid Scheme-computed Skyline_pair values to get collected before use (issue 12708048)
Date: Sun, 11 Aug 2013 19:30:46 +0000

looks quite good to me, of course.


https://codereview.appspot.com/12708048/diff/1/lily/side-position-interface.cc
File lily/side-position-interface.cc (left):

https://codereview.appspot.com/12708048/diff/1/lily/side-position-interface.cc#oldcode216
lily/side-position-interface.cc:216: Skyline my_dim;
I am merely curious whether get_*_property() creates a temporary copy of
the Scheme object.  It seems to ultimately use Scheme's assq operation,
to return the property from the list and I don't know if assq creates a
copy.

If get_*_propertry does create a temporary copy of the Scheme object,
unsmob() returns a pointer inside the object, but there is no lasting
reference to the object itself.

The function call on line 239 causes quite a lot of skylines to be
looked up, and this function aligned_side() to be called many times, so
it is not surprising if a temporary object is overwritten before the
pointer is used on line 240.

https://codereview.appspot.com/12708048/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]