Hi list,
So I'm looking at t_gpointer in m_pd.h, and I'm noticing that for arrays it has gp_w which is a union _word pointer. This is the raw data that I was asking about in my previous request for a free lesson. :)
However, in the code for [setsize] the data is resized dynamically using realloc.
So...
Suppose I have a [pointer] in a patch which is pointing to a nested array, and a [setsize] which is pointing to the container array. If I send an enormous float to [setsize], isn't it likely that realloc will move the data and my [pointer] data will silently become stale? After all, gp_w has no idea if realloc moves the data. Seems like it'd be pointing to the wrong place and likely to cause a crash.
I don't have access to a running Pd instance atm, otherwise I'd test...
Thanks,
Jonathan