Commit 78cef877 authored by Eli Zaretskii's avatar Eli Zaretskii

Speed up insertion of subprocess output on MS-Windows.

 src/ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
 first 2 arguments are identical.  This makes inserting large
 output from a subprocess an order of magnitude faster on
 MS-Windows, where all sbrk'ed memory is always contiguous.
parent 90586172
2012-02-01 Eli Zaretskii <eliz@gnu.org>
* ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
first 2 arguments are identical. This makes inserting large
output from a subprocess an order of magnitude faster on
MS-Windows, where all sbrk'ed memory is always contiguous.
2012-01-31 Glenn Morris <rgm@gnu.org>
* nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
......
......@@ -636,7 +636,8 @@ resize_bloc (bloc_ptr bloc, SIZE size)
}
else
{
memmove (b->new_data, b->data, b->size);
if (b->new_data != b->data)
memmove (b->new_data, b->data, b->size);
*b->variable = b->data = b->new_data;
}
}
......@@ -647,7 +648,8 @@ resize_bloc (bloc_ptr bloc, SIZE size)
}
else
{
memmove (bloc->new_data, bloc->data, old_size);
if (bloc->new_data != bloc->data)
memmove (bloc->new_data, bloc->data, old_size);
memset ((char *) bloc->new_data + old_size, 0, size - old_size);
*bloc->variable = bloc->data = bloc->new_data;
}
......@@ -663,7 +665,8 @@ resize_bloc (bloc_ptr bloc, SIZE size)
}
else
{
memmove (b->new_data, b->data, b->size);
if (b->new_data != b->data)
memmove (b->new_data, b->data, b->size);
*b->variable = b->data = b->new_data;
}
}
......@@ -816,7 +819,8 @@ r_alloc_sbrk (long int size)
header. */
for (b = last_bloc; b != NIL_BLOC; b = b->prev)
{
memmove (b->new_data, b->data, b->size);
if (b->new_data != b->data)
memmove (b->new_data, b->data, b->size);
*b->variable = b->data = b->new_data;
}
......@@ -862,7 +866,8 @@ r_alloc_sbrk (long int size)
for (b = first_bloc; b != NIL_BLOC; b = b->next)
{
memmove (b->new_data, b->data, b->size);
if (b->new_data != b->data)
memmove (b->new_data, b->data, b->size);
*b->variable = b->data = b->new_data;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment