On Mon, Jul 13, 2020 at 8:02 AM Amit Langote <amitlangot...@gmail.com> wrote: > By the way, considering the rebase over cd22d3cdb9b, it seemed to me > that we needed to update the comments in CopyStateData struct > definition a bit more. While doing that, I realized > CopyReadFromRawBuf as a name for the new function might be misleading > as long as we are only using it for binary data. Maybe > CopyReadBinaryData is more appropriate? See attached v4 with these > and a few other cosmetic changes. >
I had one small comment: +{ + int copied_bytes = 0; + +#define BUF_BYTES (cstate->raw_buf_len - cstate->raw_buf_index) +#define DRAIN_COPY_RAW_BUF(cstate, dest, nbytes)\ + do {\ + memcpy((dest), (cstate)->raw_buf + (cstate)->raw_buf_index, (nbytes));\ + (cstate)->raw_buf_index += (nbytes);\ + } while(0) BUF_BYTES could be used in CopyLoadRawBuf function also. Regards, Vignesh EnterpriseDB: http://www.enterprisedb.com