diff options
author | tjr <tjr@FreeBSD.org> | 2004-07-04 16:16:59 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2004-07-04 16:16:59 +0000 |
commit | ee5f93f56a2ef4f350b2806d8129fb2b520a0e4d (patch) | |
tree | f6cc1168eb91ba1e90868ec6077d80ec9ca9dba4 /gnu/usr.bin/grep/mbcache.h | |
parent | 9dea8aeba1c4f733fc95d1dfd11cfc8d3092a654 (diff) | |
download | FreeBSD-src-ee5f93f56a2ef4f350b2806d8129fb2b520a0e4d.zip FreeBSD-src-ee5f93f56a2ef4f350b2806d8129fb2b520a0e4d.tar.gz |
Make grep run much (~10x) faster in multibyte locales by caching the wide
character representation of input data across calls to dfaexec(), and by
caching the lengths of character across calls to check_multibyte_string().
Obtained from: Fedora (Tim Waugh)
Diffstat (limited to 'gnu/usr.bin/grep/mbcache.h')
-rw-r--r-- | gnu/usr.bin/grep/mbcache.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gnu/usr.bin/grep/mbcache.h b/gnu/usr.bin/grep/mbcache.h new file mode 100644 index 0000000..3b76e25 --- /dev/null +++ b/gnu/usr.bin/grep/mbcache.h @@ -0,0 +1,11 @@ +/* $FreeBSD$ */ +#ifndef MB_CACHE_DEFINED +#define MB_CACHE_DEFINED +struct mb_cache +{ + size_t len; + const char *orig_buf; /* not the only reference; do not free */ + wchar_t *wcs_buf; + unsigned char *mblen_buf; +}; +#endif |