summaryrefslogtreecommitdiff
path: root/regcomp.h
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2001-11-24 16:30:42 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-11-24 16:11:04 +0000
commitf8bef55053427841654eec6e37b8f0f4224b2976 (patch)
treeeea4e2a1545caab4e9641ad6a2230650dad6a1f9 /regcomp.h
parent30de85b6294027ce5dd68a336e7f75fe8fb14941 (diff)
downloadperl-f8bef55053427841654eec6e37b8f0f4224b2976.tar.gz
memset() is cheaper than a loop of 256 bit-a-a-times
Message-ID: <20011124163042.R37621@plum.flirble.org> p4raw-id: //depot/perl@13236
Diffstat (limited to 'regcomp.h')
-rw-r--r--regcomp.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/regcomp.h b/regcomp.h
index bbe3a41399..16cf957816 100644
--- a/regcomp.h
+++ b/regcomp.h
@@ -286,6 +286,14 @@ struct regnode_charclass_class { /* has [[:blah:]] classes */
#define ANYOF_BITMAP_CLEAR(p,c) (ANYOF_BITMAP_BYTE(p, c) &= ~ANYOF_BIT(c))
#define ANYOF_BITMAP_TEST(p, c) (ANYOF_BITMAP_BYTE(p, c) & ANYOF_BIT(c))
+#define ANYOF_BITMAP_SETALL(p) \
+ memset (ANYOF_BITMAP(p), 255, ANYOF_BITMAP_SIZE)
+#define ANYOF_BITMAP_CLEARALL(p) \
+ Zero (ANYOF_BITMAP(p), ANYOF_BITMAP_SIZE)
+/* Check that all 256 bits are all set. Used in S_cl_is_anything() */
+#define ANYOF_BITMAP_TESTALLSET(p) \
+ memEQ (ANYOF_BITMAP(p), "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377", ANYOF_BITMAP_SIZE)
+
#define ANYOF_SKIP ((ANYOF_SIZE - 1)/sizeof(regnode))
#define ANYOF_CLASS_SKIP ((ANYOF_CLASS_SIZE - 1)/sizeof(regnode))
#define ANYOF_CLASS_ADD_SKIP (ANYOF_CLASS_SKIP - ANYOF_SKIP)