<div dir="ltr">Very clear, many thanks.<br></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature">Oscar Pablo Di Liscia</div></div>
<br><div class="gmail_quote">2015-09-21 11:41 GMT-03:00 IOhannes m zmoelnig <span dir="ltr"><<a href="mailto:zmoelnig@iem.at" target="_blank">zmoelnig@iem.at</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 2015-09-21 16:24, oscar pablo di liscia wrote:<br>
> Many thanks.<br>
</span><span class="">> So that, if a table is not used in a dsp process, and we<br>
> don't use the garray_usedindsp() function,  it is safe to change<br>
> its contents providing the fact that this change is properly<br>
> done using the access methods available?<br>
<br>
<br>
</span>really there is only a single access method (to the data) available:<br>
garray_getfloatwords() returns a pointer to an array of words which you<br>
can dereference to read or write the actual values.<br>
<br>
<br>
it's always safe to *immediately* use the data returned by<br>
garray_getfloatwords().<br>
<br>
however, if you want - for performance reasons - to cache the returned<br>
pointer, then you need some wy of invalidating it (e.g. because the<br>
table the pointer referred to has moved to some other place).<br>
that's the use case of garray_usedindsp().<br>
<br>
it builds on the assumption that only DSP objects would use this kind of<br>
optimization.<br>
as a result, you *can* only use this optimization in DSP perform<br>
routines. all other table access has to be done through<br>
garray_getfloatwords() immediately before dereferencing the pointer.<br>
<br>
<br>
<br>
if you must change the size of a table, use garray_resize_long();<br>
after that you must call garray_usedindsp() again to get the new data<br>
pointer.<br>
<br>
hopefully this makes it a bit clearer.<br>
<br>
fgmasdr<br>
<span class="HOEnZb"><font color="#888888">IOhannes<br>
<br>
</font></span><br>_______________________________________________<br>
<a href="mailto:Pd-list@lists.iem.at">Pd-list@lists.iem.at</a> mailing list<br>
UNSUBSCRIBE and account-management -> <a href="http://lists.puredata.info/listinfo/pd-list" rel="noreferrer" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
<br></blockquote></div><br></div>