guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Implement efficient 'scm_unget_bytes' and 'unget-bytevector'


From: Mike Gran
Subject: Re: [PATCH] Implement efficient 'scm_unget_bytes' and 'unget-bytevector'
Date: Sat, 6 Apr 2013 03:01:51 -0700 (PDT)

>>  I discovered that 'scm_unget_byte' is kind of dumb.  It puts the 
> bytes
>>  at the beginning of the pushback buffer instead of the end.  This means
>>  that every time you unget a byte, it has to shift up the existing
>>  contents of the buffer, so ungetting N bytes takes O(N^2) time.
>> 
>>  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.
 
Have you checked that it works with gnome-vfs-port in guile-gnome?
 
It is true that none of Guile's clients ever look at putback_buf?
 
-Mike 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]