Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType
Commits:
-
de151657
by Daniel McArdle at 2021-05-13T23:08:31-04:00
3 changed files:
Changes:
1 |
+2021-05-13 Daniel McArdle <dmcardle@chromium.org>
|
|
2 |
+ |
|
3 |
+ [psaux] Use doubling allocation strategy for CF2_ArrStack.
|
|
4 |
+ |
|
5 |
+ Fixes timeout reported as
|
|
6 |
+ |
|
7 |
+ https://crbug.com/1206181
|
|
8 |
+ |
|
9 |
+ * src/psaux/psarrst.c (cf2_arrstack_{push,init}): Implement it.
|
|
10 |
+ * src/psaux/psarrst.h (CF2_ArrStackiRec): Drop `chunk'.
|
|
11 |
+ |
|
1 | 12 |
2021-05-12 Alexei Podtelezhnikov <apodtele@gmail.com>
|
2 | 13 |
|
3 | 14 |
* src/smooth/ftgrays.c (FT_MAX_GRAY_SPANS): Increase from 10 to 16.
|
... | ... | @@ -65,7 +65,6 @@ |
65 | 65 |
arrstack->error = error;
|
66 | 66 |
arrstack->sizeItem = sizeItem;
|
67 | 67 |
arrstack->allocated = 0;
|
68 |
- arrstack->chunk = 10; /* chunks of 10 items */
|
|
69 | 68 |
arrstack->count = 0;
|
70 | 69 |
arrstack->totalSize = 0;
|
71 | 70 |
arrstack->ptr = NULL;
|
... | ... | @@ -216,9 +215,9 @@ |
216 | 215 |
|
217 | 216 |
if ( arrstack->count == arrstack->allocated )
|
218 | 217 |
{
|
219 |
- /* grow the buffer by one chunk */
|
|
218 |
+ /* increase the buffer size */
|
|
220 | 219 |
if ( !cf2_arrstack_setNumElements(
|
221 |
- arrstack, arrstack->allocated + arrstack->chunk ) )
|
|
220 |
+ arrstack, arrstack->allocated * 2 + 16 ) )
|
|
222 | 221 |
{
|
223 | 222 |
/* on error, ignore the push */
|
224 | 223 |
return;
|
... | ... | @@ -55,7 +55,6 @@ FT_BEGIN_HEADER |
55 | 55 |
|
56 | 56 |
size_t sizeItem; /* bytes per element */
|
57 | 57 |
size_t allocated; /* items allocated */
|
58 |
- size_t chunk; /* allocation increment in items */
|
|
59 | 58 |
size_t count; /* number of elements allocated */
|
60 | 59 |
size_t totalSize; /* total bytes allocated */
|
61 | 60 |
|