diff options
author | Tom Lane | 2015-05-24 16:40:38 +0000 |
---|---|---|
committer | Tom Lane | 2015-05-24 16:40:38 +0000 |
commit | 23116d5437d0e8d077e7fd5391f5fa0fc781b7d2 (patch) | |
tree | f2479e4939349fe4b922e84fe625165e1123d69e /src/include/regex | |
parent | 91e79260f636ab4d5a43910b6a38bc75651ad14c (diff) |
Add a bit more commentary about regex's colormap tree data structure.
Per an off-list question from Piotr Stefaniak.
Diffstat (limited to 'src/include/regex')
-rw-r--r-- | src/include/regex/regguts.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/include/regex/regguts.h b/src/include/regex/regguts.h index 7d5d85577d6..2f3be1aa0ae 100644 --- a/src/include/regex/regguts.h +++ b/src/include/regex/regguts.h @@ -162,6 +162,10 @@ typedef int pcolor; /* what color promotes to */ * deep (in the past it was shallower during construction but was "filled" * to full depth at the end of that); areas that are unaltered as yet point * to "fill blocks" which are entirely WHITE in color. + * + * Leaf-level tree blocks are of type "struct colors", while upper-level + * blocks are of type "struct ptrs". Pointers into the tree are generally + * declared as "union tree *" to be agnostic about what level they point to. */ /* the tree itself */ @@ -179,6 +183,7 @@ union tree struct ptrs ptrs; }; +/* use these pseudo-field names when dereferencing a "union tree" pointer */ #define tcolor colors.ccolor #define tptr ptrs.pptr |