gi: extract returned array free code