зеркало из https://github.com/mozilla/pjs.git
bug 408124. increase size of regexp arena to avoid unnecessary additional allocations. r=crowder
This commit is contained in:
Родитель
c442ab5337
Коммит
416695c7a7
|
@ -3371,7 +3371,14 @@ js_ExecuteRegExp(JSContext *cx, JSRegExp *re, JSString *str, size_t *indexp,
|
||||||
gData.start = start;
|
gData.start = start;
|
||||||
gData.skipped = 0;
|
gData.skipped = 0;
|
||||||
|
|
||||||
JS_INIT_ARENA_POOL(&gData.pool, "RegExpPool", 8096, 4,
|
/*
|
||||||
|
* To avoid multiple allocations in InitMatch(), the arena size parameter
|
||||||
|
* should be at least as big as:
|
||||||
|
* INITIAL_BACKTRACK
|
||||||
|
* + (sizeof(REProgState) * INITIAL_STATESTACK)
|
||||||
|
* + (offsetof(REMatchState, parens) + avgParanSize * sizeof(RECapture))
|
||||||
|
*/
|
||||||
|
JS_INIT_ARENA_POOL(&gData.pool, "RegExpPool", 12288, 4,
|
||||||
&cx->scriptStackQuota);
|
&cx->scriptStackQuota);
|
||||||
x = InitMatch(cx, &gData, re, length);
|
x = InitMatch(cx, &gData, re, length);
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче