Fix refcounting of array-passed args
Sometimes to pass a variable number of argument we allocate an array, store the arguments in that array, and then pass the array as the single C-level arg. This caused ref issues where the refcounter thought that the variables were dead after the store -- ie before the function call -- and it would decref them right then. This commit adds a "refUsed" hook that allows us to specify these sorts of "non-IR-based" uses. Another option would have been to make the arrays fully refcounted (ie the array itself is treated as owning references to its contents), but in this case I think that's overkill since it's really just an ABI issue that the refcounter didn't understand.
Showing
Please register or sign in to comment