This doesn't answer your question, and im also not a developer, but without seeing the functions guts, it looks like you could shorten your last 6 vars to Vectors, and that would likely save you the resources your looking to save.
clampv(VECTOR to return, VECTOR to clamp, VECTOR lower, VECTOR upper);
you could then access upper A as upper.x, upper B as upper.y and so on...
Hope this helps.