handle refcounts for runtime functions that deal with vectors