aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog14
-rw-r--r--src/ralloc.c15
2 files changed, 20 insertions, 9 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index c41202bcfee..eebb10fb472 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,10 +1,17 @@
12012-02-01 Kenichi Handa <handa@m17n.org> 12012-02-02 Kenichi Handa <handa@m17n.org>
2 2
3 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to 3 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
4 NULL (Bug#6988). 4 NULL (Bug#6988).
5 (x_produce_glyphs): If the component of a composition is a null 5 (x_produce_glyphs): If the component of a composition is a null
6 string, set it->pixel_width to 1 to avoid zero-width glyph. 6 string, set it->pixel_width to 1 to avoid zero-width glyph.
7 7
82012-02-01 Eli Zaretskii <eliz@gnu.org>
9
10 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
11 first 2 arguments are identical. This makes inserting large
12 output from a subprocess an order of magnitude faster on
13 MS-Windows, where all sbrk'ed memory is always contiguous.
14
82012-01-31 Glenn Morris <rgm@gnu.org> 152012-01-31 Glenn Morris <rgm@gnu.org>
9 16
10 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>: 17 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
@@ -21,7 +28,6 @@
21 28
222012-01-28 Chong Yidong <cyd@gnu.org> 292012-01-28 Chong Yidong <cyd@gnu.org>
23 30
24
25 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550). 31 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
26 32
272012-01-26 Chong Yidong <cyd@gnu.org> 332012-01-26 Chong Yidong <cyd@gnu.org>
@@ -2376,7 +2382,7 @@
2376 Remove unreachable code. 2382 Remove unreachable code.
2377 (read_hex, load_charset_map_from_file): Check for integer overflow. 2383 (read_hex, load_charset_map_from_file): Check for integer overflow.
2378 2384
2379 * xterm.c: don't go over XClientMessageEvent limit 2385 * xterm.c: Don't go over XClientMessageEvent limit.
2380 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed. 2386 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
2381 (x_send_scroll_bar_event): Likewise. Check that the size does not 2387 (x_send_scroll_bar_event): Likewise. Check that the size does not
2382 exceed limits imposed by XClientMessageEvent, as well as the usual 2388 exceed limits imposed by XClientMessageEvent, as well as the usual
@@ -5667,7 +5673,7 @@
5667 5673
5668 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'. 5674 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
5669 5675
5670 ccl: add integer overflow checks 5676 ccl: Add integer overflow checks.
5671 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT): 5677 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
5672 (IN_INT_RANGE): New macros. 5678 (IN_INT_RANGE): New macros.
5673 (ccl_driver): Use them to check for integer overflow when 5679 (ccl_driver): Use them to check for integer overflow when
diff --git a/src/ralloc.c b/src/ralloc.c
index 13587b9ffd4..896ad9f3155 100644
--- a/src/ralloc.c
+++ b/src/ralloc.c
@@ -636,7 +636,8 @@ resize_bloc (bloc_ptr bloc, SIZE size)
636 } 636 }
637 else 637 else
638 { 638 {
639 memmove (b->new_data, b->data, b->size); 639 if (b->new_data != b->data)
640 memmove (b->new_data, b->data, b->size);
640 *b->variable = b->data = b->new_data; 641 *b->variable = b->data = b->new_data;
641 } 642 }
642 } 643 }
@@ -647,7 +648,8 @@ resize_bloc (bloc_ptr bloc, SIZE size)
647 } 648 }
648 else 649 else
649 { 650 {
650 memmove (bloc->new_data, bloc->data, old_size); 651 if (bloc->new_data != bloc->data)
652 memmove (bloc->new_data, bloc->data, old_size);
651 memset ((char *) bloc->new_data + old_size, 0, size - old_size); 653 memset ((char *) bloc->new_data + old_size, 0, size - old_size);
652 *bloc->variable = bloc->data = bloc->new_data; 654 *bloc->variable = bloc->data = bloc->new_data;
653 } 655 }
@@ -663,7 +665,8 @@ resize_bloc (bloc_ptr bloc, SIZE size)
663 } 665 }
664 else 666 else
665 { 667 {
666 memmove (b->new_data, b->data, b->size); 668 if (b->new_data != b->data)
669 memmove (b->new_data, b->data, b->size);
667 *b->variable = b->data = b->new_data; 670 *b->variable = b->data = b->new_data;
668 } 671 }
669 } 672 }
@@ -816,7 +819,8 @@ r_alloc_sbrk (long int size)
816 header. */ 819 header. */
817 for (b = last_bloc; b != NIL_BLOC; b = b->prev) 820 for (b = last_bloc; b != NIL_BLOC; b = b->prev)
818 { 821 {
819 memmove (b->new_data, b->data, b->size); 822 if (b->new_data != b->data)
823 memmove (b->new_data, b->data, b->size);
820 *b->variable = b->data = b->new_data; 824 *b->variable = b->data = b->new_data;
821 } 825 }
822 826
@@ -862,7 +866,8 @@ r_alloc_sbrk (long int size)
862 866
863 for (b = first_bloc; b != NIL_BLOC; b = b->next) 867 for (b = first_bloc; b != NIL_BLOC; b = b->next)
864 { 868 {
865 memmove (b->new_data, b->data, b->size); 869 if (b->new_data != b->data)
870 memmove (b->new_data, b->data, b->size);
866 *b->variable = b->data = b->new_data; 871 *b->variable = b->data = b->new_data;
867 } 872 }
868 } 873 }