Organize allocation logic in generator, add pb_bytes_ptr_t.