Preallocate array size in all()