[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MiNT] vim slow
On 01/10/14 08:59, Alan Hourihane wrote:
> On 01/10/14 08:55, Alan Hourihane wrote:
>> On 01/10/14 07:57, Vincent Rivière wrote:
>>> On 30/09/2014 23:59, Alan Hourihane wrote:
>>>> Try the attached patch for your older vim.
>>> IIRC, I already tried that yesterday, but it didn't work.
>>> Then I looked at the documentation of Fselect() and I saw that a
>>> timeout of 0 means infinite. So I'm not sure that the patch is
>>> correct, anyway.
>> The documentation may say 0 means infinite, but looking at the
>> implementation, 0 looks like it should do the same as Fpoll.
>>
> Mmm. Actually, no it doesn't.
>
> The patch may work for vim, but may break other applications
> which relied on Fselect()'s documentation.
>
> I'll take a closer look when my systems are back online for testing.
>
Then again, having looked at what I was doing in Fpoll, the value
of 1 (taken from Fselect) is meant to simulate a small timeout that
it would be quick to occur. That obviously isn't the case and there
is a delay long enough to cause some disruption for vim.
So, a patch which should work is this...
Alan.
Index: sys/dosfile.c
===================================================================
RCS file: /mint/freemint/sys/dosfile.c,v
retrieving revision 1.43
diff -u -r1.43 dosfile.c
--- sys/dosfile.c 30 Sep 2014 10:06:08 -0000 1.43
+++ sys/dosfile.c 1 Oct 2014 08:26:08 -0000
@@ -791,6 +791,14 @@
mask = mask << 1L;
}
+ /*
+ * A value of 1 is meant to simulate a small enough delay that it's deemed
+ * unnoticeable. In practice that doesn't occur.
+ */
+ if (timeout == 1) {
+ goto cancel;
+ }
+
if (count == 0)
{
/* no data is ready yet */