diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2018-07-05 00:40:15 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2018-07-05 00:40:15 -0500 |
commit | f282f15ae747cab342559be7ec65c9bee4c9ba55 (patch) | |
tree | 84a9a850bbbf36d394dc133e86b8db22ec42f891 /user/pixman/stacksize-reduction.patch | |
parent | df3e388d1c9efb634fa37187dc00d75aeb895521 (diff) | |
download | packages-f282f15ae747cab342559be7ec65c9bee4c9ba55.tar.gz packages-f282f15ae747cab342559be7ec65c9bee4c9ba55.tar.bz2 packages-f282f15ae747cab342559be7ec65c9bee4c9ba55.tar.xz packages-f282f15ae747cab342559be7ec65c9bee4c9ba55.zip |
user/pixman: take, fix
Diffstat (limited to 'user/pixman/stacksize-reduction.patch')
-rw-r--r-- | user/pixman/stacksize-reduction.patch | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/user/pixman/stacksize-reduction.patch b/user/pixman/stacksize-reduction.patch new file mode 100644 index 000000000..38da9b3ff --- /dev/null +++ b/user/pixman/stacksize-reduction.patch @@ -0,0 +1,35 @@ +Reduce the stack footprint of pixman's function +general_composite_rect() which allocates a large buffer +`stack_scanline_buffer`. Make it `static __thread` instead. + +--- a/pixman/pixman-general.c 2015-12-27 21:37:37.000000000 +0100 ++++ b/pixman/pixman-general.c 2016-05-05 12:24:47.346661080 +0200 +@@ -128,8 +128,8 @@ + pixman_composite_info_t *info) + { + PIXMAN_COMPOSITE_ARGS (info); +- uint8_t stack_scanline_buffer[3 * SCANLINE_BUFFER_LENGTH]; +- uint8_t *scanline_buffer = (uint8_t *) stack_scanline_buffer; ++ static __thread uint8_t static_scanline_buffer[3 * SCANLINE_BUFFER_LENGTH]; ++ uint8_t *scanline_buffer = (uint8_t *) static_scanline_buffer; + uint8_t *src_buffer, *mask_buffer, *dest_buffer; + pixman_iter_t src_iter, mask_iter, dest_iter; + pixman_combine_32_func_t compose; +@@ -158,7 +158,7 @@ + if (width <= 0 || _pixman_multiply_overflows_int (width, Bpp * 3)) + return; + +- if (width * Bpp * 3 > sizeof (stack_scanline_buffer) - 15 * 3) ++ if (width * Bpp * 3 > sizeof (static_scanline_buffer) - 15 * 3) + { + scanline_buffer = pixman_malloc_ab_plus_c (width, Bpp * 3, 15 * 3); + +@@ -232,7 +232,7 @@ + if (dest_iter.fini) + dest_iter.fini (&dest_iter); + +- if (scanline_buffer != (uint8_t *) stack_scanline_buffer) ++ if (scanline_buffer != (uint8_t *) static_scanline_buffer) + free (scanline_buffer); + } + |