API for fast construction of packed arrays