[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Implement efficient 'scm_unget_bytes' and use it
From: |
Chris K. Jester-Young |
Subject: |
Re: [PATCH] Implement efficient 'scm_unget_bytes' and use it |
Date: |
Sat, 6 Apr 2013 03:39:13 -0400 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
On Sat, Apr 06, 2013 at 02:28:14AM -0400, Mark H Weaver wrote:
> This patch implements a function 'scm_unget_bytes' that enables large
> buffers to be unread efficiently. It keeps the bytes at the end of the
> buffer instead of the beginning, but it can cope if some external code
> manipulates the pushback buffer by hand and puts the bytes at the
> beginning.
Looks good to me! I did write a comment on IRC about how the following
lines
+ if (new_len > pt->read_buf_size)
+ /* The putback buffer needs to be enlarged. */
used inconsistent references to "read_buf" and "putback buffer", but
I don't think there's a very good solution for that, other than just
making the human reader aware that read_buf _is_ putback_buf in this
context.
Cheers,
Chris.