Dynamic allocation of data arrays