OptionMaxBacktrackingStackSize limits the number of integer slots used by a match's backtracking stack. Negative values disable the limit. A match that exceeds the limit returns ErrBacktrackingStackLimit.
(n int)
| 108 | // OptionMaxBacktrackingStackSize limits the number of integer slots used by a match's backtracking stack. |
| 109 | // Negative values disable the limit. A match that exceeds the limit returns ErrBacktrackingStackLimit. |
| 110 | func OptionMaxBacktrackingStackSize(n int) CompileOption { |
| 111 | return compileOptionFunc(func(c *compileConfig) { |
| 112 | c.optimizations.MaxBacktrackingStackSize = n |
| 113 | }) |
| 114 | } |
| 115 | |
| 116 | // OptionMaxCachedRuneBufferLength limits retained string-to-rune buffers in the shared size-classed pool. |
| 117 | func OptionMaxCachedRuneBufferLength(n int) CompileOption { |