This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
sv.h: Document SVt_INVLIST fields
authorKarl Williamson <khw@cpan.org>
Mon, 21 Jul 2014 15:43:04 +0000 (09:43 -0600)
committerKarl Williamson <khw@cpan.org>
Mon, 21 Jul 2014 16:08:59 +0000 (10:08 -0600)
sv.h

diff --git a/sv.h b/sv.h
index 68e5db1..753b5bb 100644 (file)
--- a/sv.h
+++ b/sv.h
@@ -545,9 +545,14 @@ struct xpvlv {
 
 struct xpvinvlist {
     _XPV_HEAD;
-    IV          prev_index;
-    STRLEN     iterator;
-    bool       is_offset;      /* */
+    IV          prev_index;     /* caches result of previous invlist_search() */
+    STRLEN     iterator;       /* Stores where we are in iterating */
+    bool       is_offset;      /* The data structure for all inversion lists
+                                   begins with an element for code point U+0000.
+                                   If this bool is set, the actual list contains
+                                   that 0; otherwise, the list actually begins
+                                   with the following element.  Thus to invert
+                                   the list, merely toggle this flag  */
 };
 
 /* This structure works in 3 ways - regular scalar, GV with GP, or fast