diff options
author | Chong Yidong <cyd@stupidchicken.com> | 2006-02-20 16:44:09 +0000 |
---|---|---|
committer | Chong Yidong <cyd@stupidchicken.com> | 2006-02-20 16:44:09 +0000 |
commit | a073faa64c7fd0d5b6c21439cfcf08f9a36b4905 (patch) | |
tree | 714e276bd96cab1a7193cd2fdccd6eb9562728c2 /src/regex.c | |
parent | a77f947b23c1cc19f049b2d70b930f974bde6540 (diff) | |
download | emacs-a073faa64c7fd0d5b6c21439cfcf08f9a36b4905.tar.gz emacs-a073faa64c7fd0d5b6c21439cfcf08f9a36b4905.tar.bz2 emacs-a073faa64c7fd0d5b6c21439cfcf08f9a36b4905.zip |
* regex.c: Revert 2006-02-19 change.
Redefine malloc -> xmalloc, realloc -> xrealloc as in Emacs case.
Diffstat (limited to 'src/regex.c')
-rw-r--r-- | src/regex.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/regex.c b/src/regex.c index 9cc6c8c08ee..cde361e62ce 100644 --- a/src/regex.c +++ b/src/regex.c @@ -217,6 +217,15 @@ xrealloc (block, size) return val; } +# ifdef malloc +# undef malloc +# endif +# define malloc xmalloc +# ifdef realloc +# undef realloc +# endif +# define realloc xrealloc + /* When used in Emacs's lib-src, we need to get bzero and bcopy somehow. If nothing else has been done, use the method below. */ # ifdef INHIBIT_STRING_HEADER @@ -2103,10 +2112,10 @@ extend_range_table_work_area (work_area) work_area->allocated += 16 * sizeof (int); if (work_area->table) work_area->table - = (int *) xrealloc (work_area->table, work_area->allocated); + = (int *) realloc (work_area->table, work_area->allocated); else work_area->table - = (int *) xmalloc (work_area->allocated); + = (int *) malloc (work_area->allocated); } #ifdef emacs @@ -3644,11 +3653,11 @@ regex_compile (pattern, size, syntax, bufp) if (! fail_stack.stack) fail_stack.stack - = (fail_stack_elt_t *) xmalloc (fail_stack.size + = (fail_stack_elt_t *) malloc (fail_stack.size * sizeof (fail_stack_elt_t)); else fail_stack.stack - = (fail_stack_elt_t *) xrealloc (fail_stack.stack, + = (fail_stack_elt_t *) realloc (fail_stack.stack, (fail_stack.size * sizeof (fail_stack_elt_t))); } @@ -6328,14 +6337,14 @@ regcomp (preg, pattern, cflags) preg->used = 0; /* Try to allocate space for the fastmap. */ - preg->fastmap = (char *) xmalloc (1 << BYTEWIDTH); + preg->fastmap = (char *) malloc (1 << BYTEWIDTH); if (cflags & REG_ICASE) { unsigned i; preg->translate - = (RE_TRANSLATE_TYPE) xmalloc (CHAR_SET_SIZE + = (RE_TRANSLATE_TYPE) malloc (CHAR_SET_SIZE * sizeof (*(RE_TRANSLATE_TYPE)0)); if (preg->translate == NULL) return (int) REG_ESPACE; |