On Mon, 3 Jul 2006 21:08:22 -0400 Adam Montague amontague@siriushosting.com wrote:
If you resize an array you will lose the reference.
How come? I mean, I see that realloc_array creates a whole new array, but why does it do that? Couldn't it just realloc the array of svalues and adjust size and malloced_size?
Adam
To clarify, I don't mean "can we change how realloc_array works". I am just wondering if its safe for me to make my own array resizing function just for this. If I lock the array with its mutex, then realloc() the item array, and adjust the size and malloced_size, then unlock the mutex am I safe? What is the real_item[1] for?
And while I am at it, how come pike doesn't have explicit pass by reference? Are there objections to adding it?
Thanks Adam