diff options
author | Nicholas Clark <nick@ccl4.org> | 2001-11-24 16:30:42 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-11-24 16:11:04 +0000 |
commit | f8bef55053427841654eec6e37b8f0f4224b2976 (patch) | |
tree | eea4e2a1545caab4e9641ad6a2230650dad6a1f9 /regcomp.h | |
parent | 30de85b6294027ce5dd68a336e7f75fe8fb14941 (diff) | |
download | perl-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.h | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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) |