Zdenek Kabelac
47419d21ac
cleanup: stack usage
...
Shortening code with macros return_0, return_NULL.
Add some missing stack prints in error paths.
2013-07-01 23:11:14 +02:00
Zdenek Kabelac
132306c888
cleanup: add __attribute__ ((nonnull(1)))
2012-08-23 14:37:52 +02:00
Zdenek Kabelac
511a5f3ad8
Add test for memory allocation failures
...
Replace asserts with test for failing memory allocation.
Add at least stack traces.
Index counter starts from 1 (0 reserved for error), so replacing fingerprint.
2012-02-10 13:49:29 +00:00
Zdenek Kabelac
a1eba521e3
Fix some unmatching sign comparation gcc warnings
...
Simple replacement for unsigned type - usually in for() loops.
2011-04-08 14:40:18 +00:00
Zdenek Kabelac
303923fbf1
Use const char* const * for dm_regex_create()
...
Change API interface to accept even completely const array patterns.
This should present no change for libdm users and allows to pass
pattern arrays without cast to const char **.
2010-12-20 13:23:11 +00:00
Zdenek Kabelac
2e3be4f3fd
Optimize lookup table read
...
Reread lookup table only when needed.
2010-11-29 14:25:13 +00:00
Zdenek Kabelac
4cb0f557d9
Remove dead assignment in _step_matcher
...
'ns' is not used after this assignment and it is reassigned with the following
code, so dropping this assignment.
2010-11-29 12:43:49 +00:00
Alasdair Kergon
31ed6045f9
lost line
2010-11-02 20:10:35 +00:00
Alasdair Kergon
4b429b6c33
Fix regex optimiser not to ignore RHS of OR nodes in _find_leftmost_common.
2010-11-02 19:56:33 +00:00
Alasdair Kergon
ac0252ca07
Add dm_zalloc and use it and dm_pool_zalloc throughout.
2010-09-30 21:06:50 +00:00
Joe Thornber
0ae41c4412
[REGEX] fix a long standing off-by-one error (found by valgrind-pool)
2010-08-09 10:58:27 +00:00
Joe Thornber
fae2c49259
[REGEX] fix bug in matcher that was causing segfault with chars of 0x80 and over.
2010-08-09 10:30:52 +00:00
Joe Thornber
7def56f1e4
[REGEX] Parse regexes that contain chars with value > 0x80
...
This is a long standing issue. Fixed by casting a char value to
unsigned char before using it as an index into a bitset.
2010-08-09 10:29:42 +00:00
Joe Thornber
5b39a977ca
[REGEX] calculate dfa states on demand
2010-07-21 12:09:12 +00:00
Joe Thornber
ed72f7e13a
[REGEX] remove the state_queue structure.
...
Instead we just have a 'next' field in the dfa_state.
2010-07-21 12:02:51 +00:00
Joe Thornber
aab1bfd693
[REGEX] factor _calc_state() out of _calc_states()
2010-07-21 12:00:53 +00:00
Joe Thornber
529edb1853
[REGEX] reduce the number of charset nodes that are produced
2010-07-21 11:58:49 +00:00
Joe Thornber
fee2e890af
[REGEX] add a fingerprinting facility to allow test code to compare dfas
2010-07-20 15:32:07 +00:00
Alasdair Kergon
616eda51e3
don't optimise anything with TARGET_TRANS to avoid intefering with the matcher's counting
2010-04-22 23:09:18 +00:00
Alasdair Kergon
e07803f976
Cache bitset locations to speed up _calc_states. (kabi)
2010-04-22 20:35:24 +00:00
Alasdair Kergon
92f67fed0a
avoid ORs rightmost
2010-04-22 20:15:00 +00:00
Alasdair Kergon
d9c67df256
Move regex printing code from test to main tree (may use in debug messages).
...
Yet another optimiser fix attempt.
2010-04-22 17:42:38 +00:00
Alasdair Kergon
0e8134800e
Don't walk rightmost through NULL pointers.
2010-04-22 14:33:14 +00:00
Alasdair Kergon
6d3dd87bba
Fix rightmost rotation, and use LEFT and RIGHT to make symmetry more obvious.
2010-04-22 13:42:34 +00:00
Alasdair Kergon
cab2199de8
fix leftmost rotation
2010-04-22 13:18:27 +00:00
Alasdair Kergon
dbd20bbdb7
Still not satisfactory...
2010-04-22 03:24:24 +00:00
Alasdair Kergon
b2bd4e2d8d
Add a regex optimisation pass for shared character prefixes.
2010-04-20 22:31:22 +00:00
Alasdair Kergon
b8175c33da
Use INTERNAL_ERROR definition consistently in internal error messages.
2010-03-25 18:22:04 +00:00
Alasdair Kergon
3e5b6ed214
more tweaking to get things to compile - dmlib.h for log fns, list.h
2008-11-03 18:59:59 +00:00
Alasdair Kergon
147d5faccf
Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1.
2007-08-21 16:26:07 +00:00
Alasdair Kergon
38862fcd3f
Add regex functions to library.
2007-04-27 18:40:23 +00:00