bug 408124. increase size of regexp arena to avoid unnecessary additional allocations. r=crowder

This commit is contained in:
pavlov@pavlov.net 2007-12-12 16:12:30 -08:00
Родитель c442ab5337
Коммит 416695c7a7
1 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -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);