From b7eaafcb3e67c8dcd4d8e9069290a23ef2add6a8 Mon Sep 17 00:00:00 2001 From: d6 Date: Sun, 30 Jan 2022 19:26:16 -0500 Subject: [PATCH] even more comments --- regex.tal | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/regex.tal b/regex.tal index c8583e9..1ea2849 100644 --- a/regex.tal +++ b/regex.tal @@ -408,6 +408,10 @@ ( ) ( the stack can be cleared using ;reset-stack, which resets ) ( the stack pointers but does not zero out any memory. ) +( ) +( stack size is 4096 bytes here but is configurable. ) +( in some cases it could be very small but this will limit ) +( how many branches can be parsed and executed. ) ( push 4 bytes onto the stack ) @push4 ( str* regex* -> ) @@ -466,6 +470,10 @@ ( the arena is used to allocate regex graph nodes, which are ) ( dynamically-allocated as the regex string is parsed. once ) ( a regex is no longer needed the arena may be reclaimed. ) +( ) +( arena size is 1024 bytes here but is configurable. ) +( smaller sizes would likely be fine but will limit the ) +( overall complexity of regexes to be parsed and executed. ) ( reclaim all the memory used by the arena ) @reset-arena ( -> )