allocate buffer