Re: [q-lang-users] Libqint and the stability of qexps
Brought to you by:
agraef
From: Albert G. <Dr....@t-...> - 2006-06-06 18:02:40
|
John Cowan wrote: > Is it necessary to call qnewref() on each newly constructed qexp, or only > on the top-level qexp? Normally the toplevels should be enough, since the subexprs will per definition be referred to by other exprs and hence have a nonzero refcount anyway. But if you keep a pointer to, say, both Y = F X and X, then you should count a ref to both X and Y unless you can be sure that X and Y will always be thrown away at the same time. Otherwise just make it a habit to do a qnewref whenever you assign an expr pointer to a C variable, and make sure that you have a qfreeref after the last reference to the C variable (e.g., at the end of the block for an automatic variable). -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |